tailscale/net/netns
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
..
netns_android.go all: remove old +build tags 2022-11-04 07:25:42 -07:00
netns_darwin.go net/netns, net/interfaces: explicitly bind sockets to the default interface on all Darwin variants 2022-12-05 13:33:20 -08:00
netns_default.go net/netns, net/interfaces: explicitly bind sockets to the default interface on all Darwin variants 2022-12-05 13:33:20 -08:00
netns_linux_test.go net/netns: support !CAP_NET_ADMIN 2021-07-14 10:01:14 -07:00
netns_linux.go all: remove old +build tags 2022-11-04 07:25:42 -07:00
netns_test.go net/netns: thread logf into control functions 2021-11-18 15:09:51 -08:00
netns_windows.go net/netns: thread logf into control functions 2021-11-18 15:09:51 -08:00
netns.go syncs, all: move to using Go's new atomic types instead of ours 2022-08-04 07:47:59 -07:00
socks.go all: remove old +build tags 2022-11-04 07:25:42 -07:00