You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
6 months ago
..
interfaces.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 6 months ago
interfaces_bsd.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 6 months ago
interfaces_darwin.go ipn/ipnlocal: add delegated interface information to /interfaces PeerAPI handler 1 year ago
interfaces_darwin_test.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 6 months ago
interfaces_default_route_test.go all: update copyright and license headers 1 year ago
interfaces_defaultrouteif_todo.go all: update copyright and license headers 1 year ago
interfaces_freebsd.go net/interfaces: redo how we get the default interface on macOS and iOS 1 year ago
interfaces_linux.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 6 months ago
interfaces_linux_test.go all: use tstest.Replace more 1 year ago
interfaces_test.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 6 months ago
interfaces_windows.go net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 6 months ago
interfaces_windows_test.go all: update copyright and license headers 1 year ago