Jonathan Nobels fb47824d74
wgengine: return explicit lo0 for loopback addrs on sandboxed macOS (#15493)
fixes tailscale/corp#27506

The source address link selection on sandboxed macOS doesn't deal
with loopback addresses correctly.  This adds an explicit check to ensure
we return the loopback interface for loopback addresses instead of the
default empty interface.

Specifically, this allows the dns resolver to route queries to a loopback
IP which is a common tactic for local DNS proxies.

Tested on both macos, macsys and tailscaled.  Forwarded requests to
127/8 all bound to lo0.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
2025-04-01 13:20:46 -04:00
..
2024-04-16 15:32:38 -07:00