tailscale/net/interfaces
Andrew Dunham 01286af82b net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP
Currently, we get the "likely home router" gateway IP and then iterate
through all IPs for all interfaces trying to match IPs to determine the
source IP. However, on many platforms we know what interface the gateway
is through, and thus we don't need to iterate through all interfaces
checking IPs. Instead, use the IP address of the associated interface.

This better handles the case where we have multiple interfaces on a
system all connected to the same gateway, and where the first interface
that we visit (as iterated by ForeachInterfaceAddress) isn't also the
default internet route.

Updates #8992

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I8632f577f1136930f4ec60c76376527a19a47d1f
2023-12-20 15:33:58 -05:00
..
interfaces.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 2023-12-20 15:33:58 -05:00
interfaces_bsd.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 2023-12-20 15:33:58 -05:00
interfaces_darwin.go ipn/ipnlocal: add delegated interface information to /interfaces PeerAPI handler 2023-02-27 09:39:49 -08:00
interfaces_darwin_test.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 2023-12-20 15:33:58 -05:00
interfaces_default_route_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
interfaces_defaultrouteif_todo.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
interfaces_freebsd.go net/interfaces: redo how we get the default interface on macOS and iOS 2023-02-10 16:23:37 -08:00
interfaces_linux.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 2023-12-20 15:33:58 -05:00
interfaces_linux_test.go all: use tstest.Replace more 2023-03-04 12:24:55 -08:00
interfaces_test.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 2023-12-20 15:33:58 -05:00
interfaces_windows.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 2023-12-20 15:33:58 -05:00
interfaces_windows_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00