tailscale/wgengine/netstack
James Tucker 0fb207c3d0 wgengine/netstack: deliver self-addressed packets via loopback
When a tsnet.Server dials its own Tailscale IP, TCP SYN packets are
silently dropped. In inject(), outbound packets with dst=self fail the
shouldSendToHost check and fall through to WireGuard, which has no peer
for the node's own address.

Fix this by detecting self-addressed packets in inject() using isLocalIP
and delivering them back into gVisor's network stack as inbound packets
via a new DeliverLoopback method on linkEndpoint. The outbound packet
must be re-serialized into a new PacketBuffer because outbound packets
have their headers parsed into separate views, but DeliverNetworkPacket
expects raw unparsed data.

Updates #18829

Signed-off-by: James Tucker <james@tailscale.com>
2026-02-27 14:30:41 -08:00
..
gro all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
link_endpoint.go wgengine/netstack: deliver self-addressed packets via loopback 2026-02-27 14:30:41 -08:00
netstack_linux.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
netstack_tcpbuf_default.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
netstack_tcpbuf_ios.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
netstack_test.go wgengine/netstack: deliver self-addressed packets via loopback 2026-02-27 14:30:41 -08:00
netstack_userping_apple.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
netstack_userping_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
netstack_userping.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
netstack.go wgengine/netstack: deliver self-addressed packets via loopback 2026-02-27 14:30:41 -08:00