tailscale/net
Andrea Gottardo ed1ac799c8
net/captivedetection: set Timeout on net.Dialer (#13613)
Updates tailscale/tailscale#1634
Updates tailscale/tailscale#13265

Captive portal detection uses a custom `net.Dialer` in its `http.Client`. This custom Dialer ensures that the socket is bound specifically to the Wi-Fi interface. This is crucial because without it, if any default routes are set, the outgoing requests for detecting a captive portal would bypass Wi-Fi and go through the default route instead.

The Dialer did not have a Timeout property configured, so the default system timeout was applied. This caused issues in #13265, where we attempted to make captive portal detection requests over an IPsec interface used for Wi-Fi Calling. The call to `connect()` would fail and remain blocked until the system timeout (approximately 1 minute) was reached.

In #13598, I simply excluded the IPsec interface from captive portal detection. This was a quick and safe mitigation for the issue. This PR is a follow-up to make the process more robust, by setting a 3 seconds timeout on any connection establishment on any interface (this is the same timeout interval we were already setting on the HTTP client).

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
2024-10-02 15:29:46 +00:00
..
art all: fix new lint warnings from bumping staticcheck 2024-08-22 12:31:08 -07:00
captivedetection net/captivedetection: set Timeout on net.Dialer (#13613) 2024-10-02 15:29:46 +00:00
connstats all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
dns cli: add tailscale dns query (#13368) 2024-09-24 20:18:45 +00:00
dnscache net/dnscache: use parent context to perform lookup 2024-06-12 11:21:02 -07:00
dnsfallback {control,net}: close idle connections of custom transports 2024-08-05 17:28:15 +01:00
flowtrack net/flowtrack: fix, test String method 2024-06-18 21:44:44 -07:00
ipset go.mod: bump bart 2024-07-08 19:10:44 -07:00
ktimeout net/ktimeout: add a package to set TCP user timeout 2024-02-20 10:49:58 -08:00
memnet net/memnet: export the network name (#9111) 2023-08-28 11:43:51 -07:00
netaddr all: update copyright and license headers 2023-01-27 15:36:29 -08:00
netcheck net/netcheck,wgengine/magicsock: plumb OnlyTCP443 controlknob through netcheck (#13491) 2024-09-17 12:24:42 -07:00
neterror net/neterror, wgengine/magicsock: use UDP GSO and GRO on Linux (#7791) 2023-04-04 16:32:16 -07:00
netkernelconf ipn/{ipnlocal,localapi},net/netkernelconf,client/tailscale,cmd/containerboot: optionally enable UDP GRO forwarding for containers (#12410) 2024-06-10 19:19:03 +01:00
netknob all: update copyright and license headers 2023-01-27 15:36:29 -08:00
netmon all: fix new lint warnings from bumping staticcheck 2024-08-22 12:31:08 -07:00
netns net/netns: remove some logspam by avoiding logging parse errors due to unspecified addresses 2024-07-31 12:34:16 -06:00
netstat all: add test for package comments, fix, add comments as needed 2024-07-10 09:57:00 -07:00
netutil {ipn,net,tsnet}: use tsaddr helpers 2024-09-26 12:17:31 +02:00
packet wgengine/magicsock: actually use AF_PACKET socket for raw disco 2024-09-03 12:50:09 -04:00
ping net/ping: fix ICMP echo code field to 0 2023-09-15 17:08:39 -07:00
portmapper net/portmapper: don't treat 0.0.0.0 as a valid IP 2024-10-01 16:11:47 -05:00
proxymux all: cleanup unused code, part 1 (#10661) 2023-12-20 14:50:30 -08:00
routetable net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2024-04-28 07:34:52 -07:00
socks5 net/socks5: support UDP 2024-08-05 09:25:24 -07:00
sockstats net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2024-04-28 07:34:52 -07:00
speedtest all: update copyright and license headers 2023-01-27 15:36:29 -08:00
stun ci: enable checklocks workflow for specific packages 2024-06-26 13:55:07 -04:00
stunserver all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
tcpinfo all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
tlsdial cmd/tta, vnet: add host firewall, env var support, more tests 2024-08-12 15:32:12 -07:00
tsaddr net/tsaddr: add WithoutExitRoutes and IsExitRoute 2024-09-26 12:17:31 +02:00
tsdial {control,net}: close idle connections of custom transports 2024-08-05 17:28:15 +01:00
tshttpproxy all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
tstun util/usermetrics: make usermetrics non-global 2024-09-25 15:57:00 +02:00
wsconn go.{mod,sum}: migrate from nhooyr.io/websocket to github.com/coder/websocket 2024-08-14 21:23:49 -07:00