You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
7 months ago
..
batching_conn.go wgengine/magicsock: improve don't fragment bit set/get support 9 months ago
blockforever_conn.go wgengine/magicsock: improve don't fragment bit set/get support 9 months ago
debughttp.go wgengine/magicsock: stop retaining *netmap.NetworkMap 10 months ago
debugknobs.go wgengine/magicsock: replace CanPMTUD() with ShouldPMTUD() 9 months ago
debugknobs_stubs.go wgengine/magicsock: replace CanPMTUD() with ShouldPMTUD() 9 months ago
derp.go wgengine/magicsock: fix handling of derp.PeerGoneMessage (#10589) 7 months ago
discopingpurpose_string.go all: update copyright and license headers 1 year ago
endpoint.go wgengine/magicsock: move trustBestAddrUntil forward on non-disco rx (#10274) 8 months ago
endpoint_default.go all: adjust some build tags for plan9 10 months ago
endpoint_stub.go all: adjust some build tags for plan9 10 months ago
endpoint_tracker.go wgengine/magicsock: only cache N most recent endpoints per-Addr 11 months ago
endpoint_tracker_test.go wgengine/magicsock: only cache N most recent endpoints per-Addr 11 months ago
magicsock.go net/netcheck: use DERP frames as a signal for home region liveness 7 months ago
magicsock_default.go wgengine/magicsock: delete unused stuff 11 months ago
magicsock_linux.go wgengine/magicsock: simplify tryEnableUDPOffload() (#9872) 8 months ago
magicsock_test.go cmd/tailscaled,net/tstun: fix data race on start-up in TUN mode 9 months ago
magicsock_unix_test.go all: update copyright and license headers 1 year ago
peermap.go wgengine/magicsock: make peerMap also keyed by NodeID 10 months ago
peermtu.go disco,net/tstun,wgengine/magicsock: probe peer MTU 9 months ago
peermtu_darwin.go wgengine/magicsock: improve don't fragment bit set/get support 9 months ago
peermtu_linux.go wgengine/magicsock: improve don't fragment bit set/get support 9 months ago
peermtu_stubs.go wgengine/magicsock: replace CanPMTUD() with ShouldPMTUD() 9 months ago
peermtu_unix.go wgengine/magicsock: replace CanPMTUD() with ShouldPMTUD() 9 months ago
rebinding_conn.go wgengine/magicsock: improve don't fragment bit set/get support 9 months ago