mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-30 19:46:15 +00:00
Self-addressed TCP/UDP connections to a node's own <npub>.fips address half-opened and hung on macOS. macOS routes self-traffic as loopback (a LOCAL route via lo0), which defers the transport TX checksum, but the point-to-point utun then egresses the packet into the daemon with only the pseudo-header partial checksum present. The hairpin path added in9a9e90are-injected these verbatim, so the local stack dropped every segment whose checksum MSS clamping didn't happen to rewrite: the SYN/SYN-ACK got through (clamping recomputes them) but the bare ACK, data, and FIN were dropped for a bad checksum, leaving the listener stuck in SYN_RCVD. Recompute the TCP/UDP checksum for self-addressed packets on the hairpin path before re-injection, completing the self-delivery9a9e90astarted (which only covered ICMP and the TCP handshake). Linux is unaffected: it loops self-traffic via lo before the TUN, so the hairpin branch never fires and checksums are already valid. Confirmed on macOS: a self-connect that previously timed out now completes in ~9ms with payload delivered.