<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tailscale/wgengine/netstack, branch awly/deadcode-pool</title>
<subtitle>The easiest, most secure way to use WireGuard and 2FA</subtitle>
<id>http://git.waynecole.info/tailscale/atom?h=awly%2Fdeadcode-pool</id>
<link rel='self' href='http://git.waynecole.info/tailscale/atom?h=awly%2Fdeadcode-pool'/>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/'/>
<updated>2026-04-24T19:42:16Z</updated>
<entry>
<title>wgengine/netstack: absorb all quad-100 traffic locally, never leak to peers</title>
<updated>2026-04-24T19:42:16Z</updated>
<author>
<name>James Tucker</name>
<email>james@tailscale.com</email>
</author>
<published>2026-04-24T02:18:44Z</published>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/commit/?id=1b40911611b37947bdc905dec30b2914af540920'/>
<id>urn:sha1:1b40911611b37947bdc905dec30b2914af540920</id>
<content type='text'>
Previously, handleLocalPackets intercepted traffic to the Tailscale
service IP (100.100.100.100 / fd7a:115c:a1e0::53) only for an allow-list
of ports: TCP 53/80/8080 and UDP 53. Any other port returned
filter.Accept, letting the packet fall through to the ACL filter and
wireguard-go, which would attempt a peer lookup. No peer owns the
quad-100 AllowedIP, so after ~5s pendopen.go would log:

    open-conn-track: timeout opening ...; no associated peer node

This is the common "conntrack error no peer found for 100.100.100.100:853"
log spam seen in the wild (e.g. from systemd-resolved or another
resolver speculatively trying DoT on quad-100). It also leaks quad-100
packets onto the tailnet.

Remove the port allow-list so handleLocalPackets absorbs every quad-100
packet into netstack regardless of IP protocol or port. Traffic never
reaches the conntrack / peer-routing layers.

With the allow-list gone, acceptTCP needs a corresponding guard: on a
quad-100 TCP port we don't serve, execution used to fall through to the
isTailscaleIP case (quad-100 is in the tailscale IP range), which
rewrote the dial target to 127.0.0.1:&lt;port&gt; and forwardTCP'd the
connection to whatever happened to be listening on the host's loopback
at that port. Add a hittingServiceIP case that RSTs cleanly instead,
placed before the isTailscaleIP fallthrough.

TestQuad100UnservedTCPPortDoesNotForward is a new integration test that
injects a TCP SYN to 100.100.100.100:853 via handleLocalPackets, stubs
forwardDialFunc, and asserts the dialer is not invoked; it catches
regressions of the acceptTCP recursion/loopback-redirection case.

Fixes #15796
Fixes #19421
Updates #3261
Updates #11305

Signed-off-by: James Tucker &lt;james@tailscale.com&gt;
</content>
</entry>
<entry>
<title>all: fix six tests that failed with -count=2</title>
<updated>2026-04-14T01:52:57Z</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@tailscale.com</email>
</author>
<published>2026-04-14T01:27:26Z</published>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/commit/?id=9fbe4b3ed28cd68be6d25b6824bd638ab14b292e'/>
<id>urn:sha1:9fbe4b3ed28cd68be6d25b6824bd638ab14b292e</id>
<content type='text'>
Avery found a bunch of tests that fail with -count=2.

Updates tailscale/corp#40176 (tracks making our CI detect them)

Change-Id: Ie3e4398070dd92e4fe0146badddf1254749cca20
Signed-off-by: Brad Fitzpatrick &lt;bradfitz@tailscale.com&gt;
Co-authored-by: Avery Pennarun &lt;apenwarr@tailscale.com&gt;
</content>
</entry>
<entry>
<title>wgengine/netstack: fix data race on in-flight connection test globals</title>
<updated>2026-04-13T22:24:35Z</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@tailscale.com</email>
</author>
<published>2026-04-13T20:31:35Z</published>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/commit/?id=50b8cfbde2fc548a6c5b33b3c7021997ca14a0d9'/>
<id>urn:sha1:50b8cfbde2fc548a6c5b33b3c7021997ca14a0d9</id>
<content type='text'>
The maxInFlightConnectionAttemptsForTest and
maxInFlightConnectionAttemptsPerClientForTest globals were plain ints
read by background gVisor TCP handler goroutines (via
wrapTCPProtocolHandler) and written by tstest.Replace cleanup in
TestTCPForwardLimits_PerClient. When a gVisor goroutine outlived the
test cleanup window, the race detector caught the unsynchronized
access.

The race-prone code was introduced in c5abbcd4b4d8 (2024-02-26,
"wgengine/netstack: add a per-client limit for in-flight TCP
forwards") which added both the plain int globals and the
TestTCPForwardLimits_PerClient test that writes them via
tstest.Replace. It is not obvious why this has only recently started
being detected as a data race; likely some combination of gVisor
version bumps, Go toolchain scheduler changes, and additional
TCP-injecting subtests (e.g. 03461ea7f, 2026-01-30) increased
goroutine churn enough to hit the window.

Change both globals to atomic.Int32 and replace tstest.Replace (which
does non-atomic *target = old on cleanup) with explicit Store/Cleanup
pairs.

Fixes #19118

Change-Id: Id26ba6fbfb2e4ade319976db80af8e16c7c8778e
Signed-off-by: Brad Fitzpatrick &lt;bradfitz@tailscale.com&gt;
</content>
</entry>
<entry>
<title>wgengine/netstack: allow UDP listeners to receive traffic on Service VIP addresses (#18972)</title>
<updated>2026-04-08T09:53:50Z</updated>
<author>
<name>Tom Meadows</name>
<email>tom@tmlabs.co.uk</email>
</author>
<published>2026-04-08T09:53:50Z</published>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/commit/?id=5341b26328b1cd938cbaf2804a9b9c2cbf996af8'/>
<id>urn:sha1:5341b26328b1cd938cbaf2804a9b9c2cbf996af8</id>
<content type='text'>
Fixes UDP listeners on VIP Service addresses not receiving inbound traffic.

- Modified shouldProcessInbound to check for registered UDP transport endpoints when processing packets to service VIPs
- Uses FindTransportEndpoint to determine if a UDP listener exists for the destination VIP/port
- Supports both IPv4 and IPv6

The aim was to mirror the existing TCP logic, providing feature parity for UDP-based services on VIP Services.

Fixes #18971

Signed-off-by: chaosinthecrd &lt;tom@tmlabs.co.uk&gt;</content>
</entry>
<entry>
<title>wgengine/netstack: add TS_NETSTACK_KEEPALIVE_{IDLE,INTERVAL} envknobs</title>
<updated>2026-03-17T20:44:11Z</updated>
<author>
<name>Josef Bacik</name>
<email>josefbacik@anthropic.com</email>
</author>
<published>2026-03-16T19:26:25Z</published>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/commit/?id=b0e63cbeb90d57f141baa43957c81e18af755af8'/>
<id>urn:sha1:b0e63cbeb90d57f141baa43957c81e18af755af8</id>
<content type='text'>
Adds envknobs to override the netstack default TCP keepalive idle time
(~2h) and probe interval (75s) for forwarded connections.

When a tailnet peer goes away without closing its connections (pod
deleted, peer removed from the netmap, silent network partition), the
forwardTCP io.Copy goroutines block until keepalive fires: the
gvisor-side Read waits on a peer that will never send again, and the
backend-side Read waits on a backend that is alive and idle. With the
netstack default of 7200s idle + 9×75s probes, dead-peer detection
takes a little over two hours. Under high-churn forwarding — many
short-lived peers, or peers holding thousands of proxied connections
that drop at once — stuck goroutines accumulate faster than they clear.

The existing SetKeepAlive(true) at this site enables keepalive without
setting the timers; the TODO above it noted "a shorter default might
be better" and "might be a useful user-tunable". This makes both
timers tunable without changing the defaults: unset preserves the ~2h
behavior, which is the right trade-off for battery-powered peers.

The two knobs are independent — setting one leaves the other at the
netstack default. The options are set before SetKeepAlive(true) so the
timer arms with the configured values rather than the defaults —
matches the order in ipnlocal/local.go for SSH keepalive.

Updates #4522

Signed-off-by: Josef Bacik &lt;josefbacik@anthropic.com&gt;
</content>
</entry>
<entry>
<title>wgengine/netstack: don't register subnet/4via6 TCP flows with proxymap</title>
<updated>2026-03-14T02:41:30Z</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@tailscale.com</email>
</author>
<published>2026-03-13T20:51:22Z</published>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/commit/?id=54606a0a89bc5e90b5295179e5b776f6a2df8cfa'/>
<id>urn:sha1:54606a0a89bc5e90b5295179e5b776f6a2df8cfa</id>
<content type='text'>
Fixes #18991

Change-Id: I29a609dcd401854026aef4a5ad8d5806c3249ea6
Signed-off-by: Brad Fitzpatrick &lt;bradfitz@tailscale.com&gt;
</content>
</entry>
<entry>
<title>wgengine{,/magicsock}: add DERP hooks for filtering+sending packets</title>
<updated>2026-03-11T23:37:19Z</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@tailscale.com</email>
</author>
<published>2026-03-11T13:29:06Z</published>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/commit/?id=073a9a8c9ed449c1a620106084e43b0d38d1c5cb'/>
<id>urn:sha1:073a9a8c9ed449c1a620106084e43b0d38d1c5cb</id>
<content type='text'>
Add two small APIs to support out-of-tree projects to exchange custom
signaling messages over DERP without requiring disco protocol
extensions:

- OnDERPRecv callback on magicsock.Options / wgengine.Config: called for
  every non-disco DERP packet before the peer map lookup, allowing callers
  to intercept packets from unknown peers that would otherwise be dropped.

- SendDERPPacketTo method on magicsock.Conn: sends arbitrary bytes to a
  node key via a DERP region, creating the connection if needed. Thin
  wrapper around the existing internal sendAddr.

Also allow netstack.Start to accept a nil LocalBackend for use cases
that wire up TCP/UDP handlers directly without a full LocalBackend.

Updates tailscale/corp#24454

Change-Id: I99a523ef281625b8c0024a963f5f5bf5d8792c17
Signed-off-by: Brad Fitzpatrick &lt;bradfitz@tailscale.com&gt;
</content>
</entry>
<entry>
<title>wgengine/netstack: deliver self-addressed packets via loopback</title>
<updated>2026-02-27T22:30:41Z</updated>
<author>
<name>James Tucker</name>
<email>james@tailscale.com</email>
</author>
<published>2026-02-27T21:49:05Z</published>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/commit/?id=0fb207c3d045b888523914dce0b6c9e9a1abdd69'/>
<id>urn:sha1:0fb207c3d045b888523914dce0b6c9e9a1abdd69</id>
<content type='text'>
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 &lt;james@tailscale.com&gt;
</content>
</entry>
<entry>
<title>go.mod: bump gvisor</title>
<updated>2026-02-27T02:29:36Z</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@tailscale.com</email>
</author>
<published>2026-02-27T02:09:12Z</published>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/commit/?id=a98036b41d5f78d403f8328ccd88df9ba3aa441a'/>
<id>urn:sha1:a98036b41d5f78d403f8328ccd88df9ba3aa441a</id>
<content type='text'>
Updates #8043

Change-Id: Ia229ad4f28f2ff20e0bdecb99ca9e1bd0356ad8e
Signed-off-by: Brad Fitzpatrick &lt;bradfitz@tailscale.com&gt;
</content>
</entry>
<entry>
<title>wgengine/netstack: add local tailscale service IPs to route and terminate locally (#18461)</title>
<updated>2026-01-30T21:46:03Z</updated>
<author>
<name>KevinLiang10</name>
<email>37811973+KevinLiang10@users.noreply.github.com</email>
</author>
<published>2026-01-30T21:46:03Z</published>
<link rel='alternate' type='text/html' href='http://git.waynecole.info/tailscale/commit/?id=03461ea7fb9c2c318a355498811481ad9c74b119'/>
<id>urn:sha1:03461ea7fb9c2c318a355498811481ad9c74b119</id>
<content type='text'>
* wgengine/netstack: add local tailscale service IPs to route and terminate locally

This commit adds the tailscales service IPs served locally to OS routes, and
make interception to packets so that the traffic terminates locally without
making affects to the HA traffics.

Fixes tailscale/corp#34048

Signed-off-by: KevinLiang10 &lt;37811973+KevinLiang10@users.noreply.github.com&gt;

* fix test

Signed-off-by: KevinLiang10 &lt;37811973+KevinLiang10@users.noreply.github.com&gt;

* add ready field to avoid accessing lb before netstack starts

Signed-off-by: KevinLiang10 &lt;37811973+KevinLiang10@users.noreply.github.com&gt;

* wgengine/netstack: store values from lb to avoid acquiring a lock

Signed-off-by: KevinLiang10 &lt;37811973+KevinLiang10@users.noreply.github.com&gt;

* add active services to netstack on starts with stored prefs.

Signed-off-by: KevinLiang10 &lt;37811973+KevinLiang10@users.noreply.github.com&gt;

* fix comments

Signed-off-by: KevinLiang10 &lt;37811973+KevinLiang10@users.noreply.github.com&gt;

* update comments

Signed-off-by: KevinLiang10 &lt;37811973+KevinLiang10@users.noreply.github.com&gt;

---------

Signed-off-by: KevinLiang10 &lt;37811973+KevinLiang10@users.noreply.github.com&gt;</content>
</entry>
</feed>
