tailscale/net/netns
Denton Gentry 1896bf99d9 netns_linux: No namespace for localhost.
Connections to a control server or log server on localhost,
used in a number of tests, are working right now because the
calls to SO_MARK in netns fail for non-root but then we ignore
the failure when running in tests.

Unfortunately that failure in SO_MARK also affects container
environments without CAP_NET_ADMIN, breaking Tailscale
connectivity. We're about to fix netns to recognize when SO_MARK
doesn't work and use SO_BINDTODEVICE instead. Doing so makes
tests fail, as their sockets now BINDTODEVICE of the default
route and cannot connect to localhost.

Add support to skip namespacing for localhost connections,
which Darwin and Windows already do. This is not conditional
on running within a test, if you tell tailscaled to connect
to localhost it will automatically use a non-namespaced
socket to do so.

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-07-14 10:01:14 -07:00
..
netns_android.go net/netns: add Android implementation, allowing registration of JNI hook 2021-06-24 12:50:47 -07:00
netns_darwin_tailscaled.go net/{interfaces,netns}: change which build tag means mac/ios Network/System Extension 2021-06-03 08:29:22 -07:00
netns_default.go net/{interfaces,netns}: change which build tag means mac/ios Network/System Extension 2021-06-03 08:29:22 -07:00
netns_linux_test.go net/netns, net/interfaces: move defaultRouteInterface, add Android fallback 2020-08-10 13:02:47 -07:00
netns_linux.go netns_linux: No namespace for localhost. 2021-07-14 10:01:14 -07:00
netns_macios.go net/dns{,/resolver}: refactor DNS forwarder, send out of right link on macOS/iOS 2021-06-23 16:04:10 -07:00
netns_test.go netns_linux: No namespace for localhost. 2021-07-14 10:01:14 -07:00
netns_windows.go net/netns: remove use of unsafe on Windows 2020-11-14 19:53:10 -08:00
netns.go netns_linux: No namespace for localhost. 2021-07-14 10:01:14 -07:00
socks.go net/netns: move SOCKS dialing to netns for now 2020-06-01 11:00:03 -07:00