tailscale/wgengine
Andrew Dunham 7429e8912a wgengine/netstack: fix bug with duplicate SYN packets in client limit
This fixes a bug that was introduced in #11258 where the handling of the
per-client limit didn't properly account for the fact that the gVisor
TCP forwarder will return 'true' to indicate that it's handled a
duplicate SYN packet, but not launch the handler goroutine.

In such a case, we neither decremented our per-client limit in the
wrapper function, nor did we do so in the handler function, leading to
our per-client limit table slowly filling up without bound.

Fix this by doing the same duplicate-tracking logic that the TCP
forwarder does so we can detect such cases and appropriately decrement
our in-flight counter.

Updates tailscale/corp#12184

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: Ib6011a71d382a10d68c0802593f34b8153d06892
2024-03-11 08:05:00 -04:00
..
bench tailcfg, all: use []netip.AddrPort instead of []string for Endpoints 2023-10-01 18:23:02 -07:00
capture various: add golangci-lint, fix issues (#7905) 2023-04-17 18:38:24 -04:00
filter wgengine/filter: add protocol-agnostic packet checker (#10446) 2023-12-02 16:30:33 -06:00
magicsock wgengine/magicsock: don't change DERP home when not connected to control 2024-03-08 14:15:13 -05:00
netlog wgengine/netlog: fix nil pointer dereference in logtail (#8598) 2023-07-13 08:54:29 -07:00
netstack wgengine/netstack: fix bug with duplicate SYN packets in client limit 2024-03-11 08:05:00 -04:00
router wgengine/router: fix ip rule restoration 2024-02-15 11:36:40 -05:00
wgcfg all: remove LenIter, use Go 1.22 range-over-int instead 2024-02-25 12:29:45 -08:00
wgint wgengine{,/wgint}: add wgint.Peer wrapper type, add to wgengine.Engine 2024-02-28 09:50:18 -08:00
wglog wgengine/wglog: add TS_DEBUG_RAW_WGLOG envknob for raw wg logs 2024-02-24 14:59:48 -08:00
winnet all: update copyright and license headers 2023-01-27 15:36:29 -08:00
mem_ios.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
pendopen.go wgengine: make pendOpen time later, after dup check 2024-02-26 19:09:12 -08:00
userspace.go wgengine: plumb the PeerByKey from wgengine to magicsock 2024-02-28 19:36:34 -08:00
userspace_ext_test.go tsd: add package with System type to unify subsystem init, discovery 2023-05-04 14:21:59 -07:00
userspace_test.go control,tailcfg,wgengine/magicsock: add nodeAttr to enable/disable peer MTU 2023-09-21 04:17:12 -07:00
watchdog.go wgengine{,/wgint}: add wgint.Peer wrapper type, add to wgengine.Engine 2024-02-28 09:50:18 -08:00
watchdog_js.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
watchdog_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
wgengine.go wgengine{,/wgint}: add wgint.Peer wrapper type, add to wgengine.Engine 2024-02-28 09:50:18 -08:00