mirror of
https://github.com/tailscale/tailscale.git
synced 2026-10-09 11:52:00 -04:00
WriteBatchTo copied the destination IP and port into the pooled net.UDPAddr handed to sendmmsg(2), but not the zone. For an IPv6 link-local destination the sockaddr then had no scope ID, and Linux failed the send with "cannot assign requested address". Disco goes through WriteToUDPAddrPort, which keeps the zone, so magicsock could pick a link-local path whose WireGuard packets, sent via WriteBatchTo, never left the host. Set the zone on every write, so that a destination without one also clears the zone left over from an earlier write that reused the pooled address. Fixes #21411 Co-Authored-By: Jordan Whited <jordan@tailscale.com> Signed-off-by: chlee <sourcehatchery@gmail.com> Signed-off-by: Jordan Whited <jordan@tailscale.com>