tailscale/wgengine/magicsock
Jordan Whited 685b853763
wgengine/magicsock: fix handling of derp.PeerGoneMessage (#10589)
The switch in Conn.runDerpReader() on the derp.ReceivedMessage type
contained cases other than derp.ReceivedPacket that fell through to
writing to c.derpRecvCh, which should only be reached for
derp.ReceivedPacket. This can result in the last/previous
derp.ReceivedPacket to be re-handled, effectively creating a duplicate
packet. If the last derp.ReceivedPacket happens to be a
disco.CallMeMaybe it may result in a disco ping scan towards the
originating peer on the endpoints contained.

The change in this commit moves the channel write on c.derpRecvCh and
subsequent select awaiting the result into the derp.ReceivedMessage
case, preventing it from being reached from any other case. Explicit
continue statements are also added to non-derp.ReceivedPacket cases
where they were missing, in order to signal intent to the reader.

Fixes #10586

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2023-12-14 12:54:19 -08:00
..
batching_conn.go wgengine/magicsock: improve don't fragment bit set/get support 2023-09-21 04:17:12 -07:00
blockforever_conn.go wgengine/magicsock: improve don't fragment bit set/get support 2023-09-21 04:17:12 -07:00
debughttp.go wgengine/magicsock: stop retaining *netmap.NetworkMap 2023-09-11 20:07:30 -07:00
debugknobs_stubs.go wgengine/magicsock: replace CanPMTUD() with ShouldPMTUD() 2023-09-21 04:17:12 -07:00
debugknobs.go wgengine/magicsock: replace CanPMTUD() with ShouldPMTUD() 2023-09-21 04:17:12 -07:00
derp.go wgengine/magicsock: fix handling of derp.PeerGoneMessage (#10589) 2023-12-14 12:54:19 -08:00
discopingpurpose_string.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
endpoint_default.go all: adjust some build tags for plan9 2023-08-24 15:42:35 -07:00
endpoint_stub.go all: adjust some build tags for plan9 2023-08-24 15:42:35 -07:00
endpoint_tracker_test.go wgengine/magicsock: only cache N most recent endpoints per-Addr 2023-08-15 14:06:42 -07:00
endpoint_tracker.go wgengine/magicsock: only cache N most recent endpoints per-Addr 2023-08-15 14:06:42 -07:00
endpoint.go wgengine/magicsock: move trustBestAddrUntil forward on non-disco rx (#10274) 2023-11-15 16:30:50 -08:00
magicsock_default.go wgengine/magicsock: delete unused stuff 2023-07-26 11:44:41 -07:00
magicsock_linux.go wgengine/magicsock: simplify tryEnableUDPOffload() (#9872) 2023-10-18 18:50:40 -07:00
magicsock_test.go cmd/tailscaled,net/tstun: fix data race on start-up in TUN mode 2023-10-14 08:54:30 -07:00
magicsock_unix_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
magicsock.go net/netcheck: use DERP frames as a signal for home region liveness 2023-12-13 16:33:46 -05:00
peermap.go wgengine/magicsock: make peerMap also keyed by NodeID 2023-09-11 12:43:47 -07:00
peermtu_darwin.go wgengine/magicsock: improve don't fragment bit set/get support 2023-09-21 04:17:12 -07:00
peermtu_linux.go wgengine/magicsock: improve don't fragment bit set/get support 2023-09-21 04:17:12 -07:00
peermtu_stubs.go wgengine/magicsock: replace CanPMTUD() with ShouldPMTUD() 2023-09-21 04:17:12 -07:00
peermtu_unix.go wgengine/magicsock: replace CanPMTUD() with ShouldPMTUD() 2023-09-21 04:17:12 -07:00
peermtu.go disco,net/tstun,wgengine/magicsock: probe peer MTU 2023-10-09 01:57:12 -07:00
rebinding_conn.go wgengine/magicsock: improve don't fragment bit set/get support 2023-09-21 04:17:12 -07:00