tailscale/wgengine/magicsock
Brad Fitzpatrick 387e83c8fe wgengine/magicsock: fix Conn.Rebind race that let ErrClosed errors be read
There was a logical race where Conn.Rebind could acquire the
RebindingUDPConn mutex, close the connection, fail to rebind, release
the mutex, and then because the mutex was no longer held, ReceiveIPv4
wouldn't retry reads that failed with net.ErrClosed, letting that
error back to wireguard-go, which would then stop running that receive
IP goroutine.

Instead, keep the RebindingUDPConn mutex held for the entirety of the
replacement in all cases.

Updates tailscale/corp#1289

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-08 21:08:35 -08:00
..
discopingpurpose_string.go wgengine/magicsock: make discoPingPurpose a stringer 2020-09-14 14:29:28 -07:00
legacy.go wgengine/magicsock: unify on netaddr types in addrSet 2021-02-12 09:52:43 -08:00
magicsock_test.go wgengine/magicsock: fix Conn.Rebind race that let ErrClosed errors be read 2021-03-08 21:08:35 -08:00
magicsock.go wgengine/magicsock: fix Conn.Rebind race that let ErrClosed errors be read 2021-03-08 21:08:35 -08:00