tailscale/net
Brad Fitzpatrick bb4f458207 feature/captiveportal: move captive portal code out of ipnlocal, netcheck
Captive portal detection was half-migrated: it had a build tag and
buildfeatures constant, but its code still lived in build-tag-gated
files in ipn/ipnlocal and net/netcheck, with its per-backend state
(context, cancel func, signaling channel) as fields on LocalBackend.

Move it under feature/captiveportal. The health-driven detection loop
becomes an ipnext.Extension holding its own state: it starts and
stops the loop from the BackendStateChange hook and subscribes to
health.Change events on the eventbus itself, removing the captive
portal hooks and special cases from LocalBackend entirely. The DERP
map now comes from a new ipnext.NodeBackend.DERPMap method, and the
preferred DERP region from magicsock's last netcheck report (the
same underlying source as the previously used Hostinfo.NetInfo).

The netcheck probe hook is now exported with a signature free of
netcheck internals, and its implementation moves to the small
feature/captiveportal/netcheckhook package, which installs the hook
as an import side effect. That package stays free of tsd/wgengine
dependencies so the tailscale CLI can keep probing for captive
portals in "tailscale netcheck" without linking the daemon-side
extension. The net/captivedetection library itself is unchanged and
stays put; after this change it is only linked when something pulls
in netcheckhook or the feature extension.

tailscaled links the feature by default via condregister as before,
but tsnet no longer does (shrinking tsnet, k8s-operator, and tsidp);
tsnet users who want it can blank-import the feature package, and
tsnet's dep test now locks that in.

Updates #12614

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: I3f1d09f9dc03e18f9a648ab5e42d16fa540b3fa9
2026-07-14 20:22:23 -04:00
..
ace all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
art all: apply go fix 2026-07-10 17:39:16 -07:00
bakedroots all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
batching net/batching: reset Buffers len in WriteBatchTo 2026-05-31 06:12:53 -07:00
captivedetection all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
connectproxy all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
dns ipn/ipnlocal,net/dns/resolver: serve MagicDNS names from live indexes 2026-07-14 07:26:41 -07:00
dnscache net/tsdial: run happy eyeballs across A and AAAA in UserDial 2026-05-20 18:35:55 -07:00
dnsfallback net/netutil: add NewDefaultTransport to avoid http.DefaultTransport panics 2026-06-01 12:28:36 -07:00
flowtrack all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ipset all: use bart.Lite instead of bart.Table where appropriate 2026-03-24 14:45:23 +00:00
ktimeout all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
memnet all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
netaddr all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
netcheck feature/captiveportal: move captive portal code out of ipnlocal, netcheck 2026-07-14 20:22:23 -04:00
neterror all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
netkernelconf all: make this spelling mistake non-existant 2026-06-11 10:37:50 +01:00
netknob all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
netmon all: fix typos where we repeat repeat ourselves 2026-07-03 16:09:03 +01:00
netns all: don't repeat the the word "the" unnecessarily 2026-06-18 16:32:08 +01:00
netstat all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
netutil cmd/{containerboot,k8s-operator}: add 4via6 support in singleton egress (#19983) 2026-06-18 16:13:10 +01:00
netx net/tsdial: run happy eyeballs across A and AAAA in UserDial 2026-05-20 18:35:55 -07:00
packet all: fix typos where we repeat repeat ourselves 2026-07-03 16:09:03 +01:00
ping wgengine/netstack, net/ping: stop using pro-bing and use our net/ping instead 2026-05-04 14:05:24 -07:00
portmapper all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
porttrack net/porttrack: change magic listen address format for Go 1.26 2026-03-04 21:57:05 -08:00
proxymux all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
routecheck ipn/ipnlocal: use routecheck reports to make exit node suggestions 2026-07-02 20:26:27 -07:00
routemanager net/routemanager,ipn/ipnlocal: name the changed-allowed-IPs map type 2026-07-14 19:57:59 -04:00
routetable netns,wgengine: add OpenBSD support to netns via an rtable 2026-02-25 12:44:32 -08:00
sockopts all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
socks5 all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
sockstats all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
speedtest cmd/vet: add subtestnames analyzer; fix all existing violations 2026-04-05 15:52:51 -07:00
stun all: fix more typos caused by unnecessary repetition 2026-07-06 10:36:17 +01:00
stunserver all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
tcpinfo all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
tlsdial tsd, all: add Sys.ExtraRootCAs, plumb through TLS dial paths 2026-04-07 18:10:54 -07:00
traffic net/traffic: add fuzz test for sorting nodes by traffic score (#19893) 2026-05-29 11:55:49 -07:00
tsaddr net/tstun,wgengine,ipn/ipnlocal: make tstun's peerConfigTable use RouteManager table 2026-07-14 12:41:11 -07:00
tsdial net/tsdial, ipn/ipnlocal: stop using netmap.NetworkMap in Dialer 2026-06-24 13:14:45 -07:00
tshttpproxy cmd/vet: add subtestnames analyzer; fix all existing violations 2026-04-05 15:52:51 -07:00
tstun net/tstun,wgengine,ipn/ipnlocal: make tstun's peerConfigTable use RouteManager table 2026-07-14 12:41:11 -07:00
udprelay control/controlknobs,net/{batching,tstun},wgengine: add nodecaps to disable UDP & TUN GRO/GSO 2026-05-27 17:10:14 -07:00
wsconn all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00