tailscale/net/interfaces
Mihai Parparita 79f3a5d753 net/netns, net/interfaces: explicitly bind sockets to the default interface on all Darwin variants
We were previously only doing this for tailscaled-on-Darwin, but it also
appears to help on iOS. Otherwise, when we rebind magicsock UDP
connections after a cellular -> WiFi interface change they still keep
using cellular one.

To do this correctly when using exit nodes, we need to exclude the
Tailscale interface when getting the default route, otherwise packets
cannot leave the tunnel. There are native macOS/iOS APIs that we can
use to do this, so we allow those clients to override the implementation
of DefaultRouteInterfaceIndex.

Updates #6565, may also help with #5156

Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-12-05 13:33:20 -08:00
..
interfaces_bsd.go net/netns, net/interfaces: explicitly bind sockets to the default interface on all Darwin variants 2022-12-05 13:33:20 -08:00
interfaces_darwin_test.go net/interfaces: improve default route detection 2022-10-19 11:10:19 +01:00
interfaces_darwin.go net/interfaces: deduplicate route table parsing on Darwin and FreeBSD 2022-10-19 11:10:19 +01:00
interfaces_default_route_test.go all: remove old +build tags 2022-11-04 07:25:42 -07:00
interfaces_defaultrouteif_todo.go all: remove old +build tags 2022-11-04 07:25:42 -07:00
interfaces_freebsd.go all: remove old +build tags 2022-11-04 07:25:42 -07:00
interfaces_linux_test.go refactor: move from io/ioutil to io and os packages 2022-09-15 21:45:53 -07:00
interfaces_linux.go syncs, all: move to using Go's new atomic types instead of ours 2022-08-04 07:47:59 -07:00
interfaces_test.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
interfaces_windows_test.go net/interfaces: quiet PAC detection logging in no-PAC case, add benchmark 2020-10-01 22:02:39 -07:00
interfaces_windows.go go.mod: bump wireguard/windows, which moves to using net/netip 2022-08-31 08:36:56 -07:00
interfaces.go ipn/ipnlocal: don't warn about serve listener failing on IPv6-less machines 2022-11-13 10:11:25 -08:00