Files
tailscale/net
Nick Beirne 2c663f0d84 wgengine/magicsock: retry UDP reads on EADDRNOTAVAIL
A customer noticed that UDP reads returned EADDRNOTAVAIL during a link
change while the interface had no IPv4 address. magicsock returned the
error to wireguard-go, which treated it as permanent and shut down the
receive loop.

magicsock now retries the read when EADDRNOTAVAIL is returned on Unix.
Each error is counted in the magicsock_recv_udp_error_unknown metric.

EADDRNOTAVAIL isn't a documented result of a UDP recv. We suspect that
certain macOS network extensions return it while the network interface
is mid-change and has no address. We expect the error to stop once the
interface has an address again. A short delay between retries prevents
magicsock from spinning when the address doesn't come back right away.

Updates #22097

Change-Id: I70790f78d9488999ce00f9685aec3f0fabc15699
Signed-off-by: Nick Beirne <[email protected]>
2026-11-09 11:59:03 -05:00
..
2026-07-10 17:39:16 -07:00