Commit Graph
11737 Commits
Author SHA1 Message Date
Claus Lensbøl eec8725650 tstest/natlab/vmtest{,/cmd},.github/workflows: run generated tests in shards
Instead of having one runner do all the work for a test, split it up
into multiple shards so as the number of tests grows, we can add tests
without running out of time on the runners.

The test runner is also moved out of the generator to make it easier to
work on it without having to generate and without having to write the
code in the template.

Updates #21817

Signed-off-by: Claus Lensbøl <[email protected]>
2026-11-18 10:00:39 -05:00
Claus Lensbøl 240424144f .github/workflows: add weekend runner for generated tests (#22179)
Add weekend runner for smoke testing natlab generated tests.

Updates #21817

Signed-off-by: Claus Lensbøl <[email protected]>
2026-11-17 16:26:59 -05:00
Dep Updater a920394089 go.mod: bump gvisor.dev/gvisor
* gvisor.dev/gvisor: https://github.com/google/gvisor/compare/a6f909f08a72...0303b2605d5e

Triggered by @bradfitz via the bumpdep workflow.

Updates #22104

Signed-off-by: Dep Updater <[email protected]>
2026-11-17 13:10:30 -08:00
David Anderson ee54083f30 wgengine/magicsock: mirror retried hybrid handshakes over DERP
Updates tailscale/corp#50068

Signed-off-by: David Anderson <[email protected]>
Change-Id: I8971ddc5bf80edd1f342cb6bb63cee0b6a6a6964
2026-11-17 13:27:24 -07:00
David Anderson f4336907aa ipn: configure hybrid handshakes for peers that support it
Updates tailscale/corp#50068

Signed-off-by: David Anderson <[email protected]>
Change-Id: Ibebab03c31b3fceba83af28d72ddecd26a6a6964
2026-11-17 13:27:24 -07:00
Jim Wright e232b0a131 client/web,release/dist: move web client from yarn to pnpm (#22464)
Import yarn.lock into pnpm with the same supply-chain settings as
cmd/tsconnect, plus overrides replacing yarn resolutions, two narrow
trustPolicyExclude entries for packages published without provenance,
and denied esbuild/@swc/core install scripts.

Switch assets.go, cmd/build-webclient, release/dist and CI to
tool/pnpm. release/dist now looks up pnpm only when building web
client assets; Build.Yarn is deprecated.

Updates tailscale/corp#51439

Change-Id: Ib472fc8439e916bfe41158e3952f9fa8c02f522d

Signed-off-by: Jim Wright <[email protected]>
2026-11-17 13:07:03 -07:00
Mike O'DriscollandBrad Fitzpatrick 18d7c08613 derp/xdp: don't write counters back to the per-CPU map on every packet (#22460)
inc_counter looked up the per-CPU counter, incremented it in place,
and then called bpf_map_update_elem to store the same value back. For
a BPF_MAP_TYPE_PERCPU_HASH the pointer returned by the lookup already
is this CPU's slot, so the write-back was redundant, and it is the one
step that takes the hash bucket spinlock. The program runs for every
received packet, not just STUN, and updates two counters each time, so
a busy DERP paid two locked map updates per incoming TCP segment.

Keep the update only for the miss path, which runs once per key.

While here, make inc_counter and handle_counters return void. Neither
caller looked at the result.

TestXDP cleared the counters map before every case, so it only ever
exercised the key insertion path. Add a subtest that runs the same
packet repeatedly without clearing, to cover the in-place increment
of an existing key.

Regenerate the bpf2go outputs with clang 18.1.8 and the bpf2go from
the cilium/ebpf v0.22.0 already in go.mod, which is also why the
generated Go files pick up structs.HostLayout and the object name
constants.

Fixes #22463

Signed-off-by: Mike O'Driscoll <[email protected]>
Co-authored-by: Brad Fitzpatrick <[email protected]>
2026-11-17 15:02:35 -05:00
Nick Khyl 7c6e49dfb3 health: hide warnables while the backend is warming up
Since bfde8079a, the Tracker omits warnables with an unhealthy
dependency from CurrentState and Strings. But that only covered
Warnable.DependsOn. The implicit dependency on the warming-up warnable
was still only advertised via UnhealthyState.DependsOn and left to
clients to enforce. The macOS, iOS and Android clients did; the Windows
clients and the CLI did not, and showed warnings that disappeared once
the backend started.

Enforce it in the Tracker as well, so that all clients behave the same
and do not need to inspect DependsOn.

Updates tailscale/corp#44572
Updates #14796
Updates #14687

Signed-off-by: Nick Khyl <[email protected]>
2026-11-17 11:30:51 -08:00
Pedro Andrade 153f00f636 tailcfg: add StableVIPServiceID
Add a stable, opaque identifier type for VIP services, like StableNodeID
and StableTailnetID. Unlike a ServiceName, it is not reused when a
service is deleted and recreated, so it can identify a service in
records that outlive it.

Not currently used in the OSS tree; it will be used in PAM use cases
soon.

Updates tailscale/corp#49316

Signed-off-by: Pedro Andrade <[email protected]>
2026-11-17 12:08:09 -07:00
Fran Bull f3a3382791 feature/routecheck,ipn,net/routecheck,tailcfg: Probe conn25 connectors
Add conn25 connectors to the targets for routecheck probing. Enables
conn25 clients to use the routecheck report to help decide which
connector to use.

Updates tailscale/corp#47251

Signed-off-by: Fran Bull <[email protected]>
2026-11-17 10:40:12 -08:00
Jim Wright 9123e6e26c cmd/tsconnect: upgrade tsconnect from yarn to pnpm (#22437)
Import yarn.lock to pnpm-workspace.yaml and pnpm-lock.yaml
Add pnpm tool and update references

Fixes tailscale/corp#51437

Change-Id: Ia25017e7e82cf3af13e04fc3c07b82196f211744

Signed-off-by: Jim Wright <[email protected]>
2026-11-17 10:03:01 -07:00
chaosinthecrd 51a970a4e6 cmd/containerboot: add tests for egress resync on FQDN target changes
Adds table tests for shouldResync, covering peer device and Tailscale
Service targets that lose and regain their addresses, a device or
Tailscale Service that failed to resolve at the last sync, a device
replaced by a Tailscale Service, a target removed from the config, a
Service that gains a second host (which must not resync), and a 4via6
route that is withdrawn or advertised.

Updates #21159
Updates #21426

Signed-off-by: chaosinthecrd <[email protected]>
2026-11-17 16:22:01 +00:00
chaosinthecrd 076da81190 cmd/containerboot: resync egress rules when an FQDN target changes
The egress proxy only stored a target FQDN's addresses after a lookup
that returned some, and on a netmap update only compared them with peer
device names. Targets that failed to resolve, had no addresses or were
Tailscale Services were never rechecked, so their rules stayed missing
until a config change or Pod restart.

This fixes this by storing every lookup result, rebuilt on each sync,
and resolving each stored FQDN in shouldResync the same way sync does.
A target that leaves the netmap now triggers a resync too, so its rules
are removed straight away. serviceIPsFromNetMap returns each Service IP
once, so a Service gaining or losing a host doesn't cause a resync.

Fixes #21159
Fixes #21426

Signed-off-by: chaosinthecrd <[email protected]>
2026-11-17 16:22:01 +00:00
Gabriel von Winckler f3bc40b679 release/dist/qnap: drop the static package tag from QPKG_VER (#22381)
QDK's qbuild truncates QPKG_VER to 10 characters, so versions like
1.105.265-1 produced Tailscale_1.105.265-_<arch>.qpkg while we returned
(and put in the manifest) Tailscale_1.105.265-1_<arch>.qpkg. The "-1" tag
was never bumped, so drop it and use the version alone. Fail the build
if the version itself exceeds 10 characters rather than silently
producing a mismatched filename.

Built qnap/x86_64 unsigned at 1.105.280: the file on disk and the
manifest both name Tailscale_1.105.280_x86_64.qpkg, and the qpkg header
version is 1.105.280. The length guard and signed builds were not
exercised.

Updates tailscale/corp#51480

Signed-off-by: Gabriel von Winckler <[email protected]>
2026-11-17 14:31:35 +00:00
Nick Beirne 54c4153604 wgengine/magicsock: rebind on bad socket errors
On macOS and iOS, UDP reads have been observed to fail with ENOTSOCK and
EBADF. Both errors indicate that the fd is no longer usable. The receive
function would retry reading from the bad socket until some other event,
like a link change, caused a rebind.

magicsock now rebinds when a read fails with EBADF or ENOTSOCK. Read and
write failures share a single 5s throttle to handle bursts of failures.

Updates #22097

Change-Id: Idd19f7094d9fc11e0f61a3207eb20281acfd5255
Signed-off-by: Nick Beirne <[email protected]>
2026-11-17 09:09:04 -05:00
Dep Updater 46ad4538b7 go.mod: bump 5 modules
* golang.org/x/crypto: v0.58.0 to v0.59.0
* golang.org/x/mod: v0.41.0 to v0.43.0
* golang.org/x/sync: v0.24.0 to v0.25.0
* golang.org/x/text: v0.43.0 to v0.44.0
* golang.org/x/tools: v0.51.0 to v0.52.0

x/crypto v0.59.0 removed the DSA keys from ssh/testdata, so drop or
swap out the DSA test cases in tempfork/sshtest/ssh to match upstream.

Triggered by @bradfitz via the bumpdep workflow.

Updates tailscale/corp#47960

Signed-off-by: Dep Updater <[email protected]>
2026-11-16 18:55:09 -08:00
Nick Khyl 13af579d64 ipn/ipnlocal: resend UserProfiles to IPN bus watchers after a profile change
A watch session's UserProfiles dedup state was only reset when the
self node delivered to it changed, as of c9fb05b6f5. Switching to
a profile that never gets a self node, such as a stopped or logged
out one, and back delivered the same self node again, so the profiles
were not resent to watchers that had dropped them on the switch. The
Windows GUI then listed no tagged or other users' devices.

Reset the dedup state on a profile change as well.

Updates #19889
Updates tailscale/corp#51597

Signed-off-by: Nick Khyl <[email protected]>
2026-11-16 18:54:54 -08:00
Brad Fitzpatrick 203692da0a derp/derphttp, feature/derpwebsocket: add opt-in WebSocket fallback
Some HTTP proxies (as seen in ChatGPT Work's sandbox) intercept TLS and
refuse DERP's "Upgrade: DERP" request but allow WebSocket upgrades,
like browsers use. derphttp could already speak DERP over WebSockets,
but only on js/wasm or with the ts_debug_websockets build tag and an
envknob, and that path dials with its own http.Client, skipping the
DERP node selection, proxy CONNECT, and TLS logic of the normal path.

Add derphttp.HookUpgradeWebsocket. When it's set and a client's HTTP
upgrade to DERP fails after any TLS handshake succeeded, the client
redials and calls the hook to do a WebSocket handshake over the new
connection instead. Once that works, the client keeps using WebSockets
for its reconnects until they fail, so it doesn't pay for a refused
upgrade every time.

The new feature/derpwebsocket package sets the hook. Neither tailscaled
nor tsnet links it in; programs that want the fallback, like tailcat,
import it.

Updates #22412

Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: I20e4b29f1bca6e7e5e3b33f960ce9d331ec7dac9
2026-11-16 17:26:11 -08:00
Jordan Whited ca0cadf957 go.mod,wgengine/wgcfg: bump wg-go & make crypto queue sizing cgroup-aware
https://github.com/tailscale/wireguard-go/compare/9e10ef9af415...c90940ef3f06

Fixes tailscale/corp#47966

Signed-off-by: Jordan Whited <[email protected]>
2026-11-16 16:12:24 -08:00
Lim-jooyoung cfc3f365d4 drive/driveimpl/compositedav: close idle connections of replaced children
SetChildren took oldChildren from its argument instead of from
h.children, so it closed the idle connections of the children it had
just set and left those of the replaced children open.

FileSystemForRemote builds a fresh Handler for every request from its
long-lived children, so idle connections to the local file server were
closed before every request and were generally not reused.

Updates #11187

Signed-off-by: Lim-jooyoung <[email protected]>
2026-11-16 14:48:41 -08:00
Mazdak Nasab 04ed834b36 feature/conn25: resolve and count client flows atomically (#22288)
The datapath resolved a Magic IP to its Transit IP and then, in a second
lock acquisition, counted the new flow against the assignment holding
that Transit IP. A concurrent reserveAddresses could expire the
assignment in between and hand the Transit IP to an unrelated
destination, so the flow was installed DNATing to an address another
destination now owned, counted against that stranger's assignment.

Merge the two steps into ClientFlowCreatedForMagicIP, which resolves and
counts under one c.mu acquisition.

Fixes https://github.com/tailscale/corp/issues/44273

Change-Id: Iefae902267fd06a5d2c965a3570b6977921be76f

Signed-off-by: Mazdak Nasab <[email protected]>
2026-11-16 12:19:54 -07:00
Brad Fitzpatrick f301a4d7a3 wgengine/magicsock: apply DERP home and endpoints deltas to peersByID
UpdateNetmapDelta updated a peer's endpoint but not its peersByID
snapshot. A later full netmap restoring the pre-delta DERP home or
endpoints then matched the stale snapshot, so the updateNodes fast path
skipped it and magicsock kept sending to the old DERP region.

Fixes #22379

Change-Id: I361f90e6063ca9e9dde02be8074b305622e46e5b
Signed-off-by: Brad Fitzpatrick <[email protected]>
2026-11-16 09:16:50 -08:00
Mario Minardi aac0e23d1d cmd/tsconnect: stop including tailwind styles in tsconnect package CSS
pkg.css was publishing Tailwind CSS classes unnecessarily which could
cause conflicts with downstream consumers (e.g., if the downstream uses
Tailwind 4 as an example).

Only publish xterm's styles as these are needed for the components used
by the library.

Updates https://github.com/tailscale/corp/issues/50293

Signed-off-by: Mario Minardi <[email protected]>
2026-11-16 09:31:58 -07:00
Brad Fitzpatrick 99b389db5e ipn/ipnlocal: don't abandon netmap delta batches on unknown peers
nodeBackend.UpdateNetmapDelta returned false on a per-field patch for a
peer it didn't have, such as one filtered out by tailnet lock, dropping
the batch's remaining patches. LocalBackend ignored the result and
reported success, so controlclient never sent a full netmap, and its
peer dedup then hid later updates for those peers. Skip such patches
instead, and return false from LocalBackend if nodeBackend fails.

Updates #22379

Change-Id: I142bd47a89568d0f6c457f0da08601f41609d8f7
Signed-off-by: Brad Fitzpatrick <[email protected]>
2026-11-16 07:48:48 -08:00
Brad Fitzpatrick fe5726935c ipn/ipnlocal: recompute suggested exit node on exit node DERP home deltas
suggestExitNode groups candidates by DERP home region, but a HomeDERP
patch on an exit node other than the current suggestion didn't trigger
a recompute, so the suggestion could stay stale until the next full
netmap.

Updates #22379

Change-Id: Ib0c1dd9bf41fe40eac77fca378015c97fba600d1
Signed-off-by: Brad Fitzpatrick <[email protected]>
2026-11-16 07:47:51 -08:00
Dep Updater 9ad2a9623c go.mod: bump 5 modules
* github.com/gokrazy/firmware: https://github.com/gokrazy/firmware/compare/f966a2e0e4b0...6bd1fd16a2e2
* github.com/gokrazy/kernel.amd64: https://github.com/gokrazy/kernel.amd64/compare/5a347b66f180...eb0ff0075854
* github.com/gokrazy/kernel.arm64: https://github.com/gokrazy/kernel.arm64/compare/3998e71b7b1d...595ae821533a
* github.com/gokrazy/kernel.rpi: https://github.com/gokrazy/kernel.rpi/compare/2cbf751e3f2a...85ea215f0624
* github.com/gokrazy/rpi-eeprom: https://github.com/gokrazy/rpi-eeprom/compare/6a92fdda349c...30711eb43bb5
* github.com/gokrazy/breakglass: already current
* github.com/gokrazy/gokrazy: already current
* github.com/gokrazy/serial-busybox: already current

Triggered by the gokrazy-bump workflow's schedule.

Updates #1866

Signed-off-by: Dep Updater <[email protected]>
2026-11-15 22:03:10 -08:00
Brad Fitzpatrick 6e16dac9e9 net/netmon: make static monitors work without netlink
Userspace-only programs like tailcat don't need to watch the OS
network state, so in sandboxes without netlink access (as in ChatGPT
Work's) they'd like to use netmon.NewStatic instead of netmon.New,
which fails there. But two things broke with a static Monitor:

If reading the interface state failed, NewStatic left it nil, and
callers of InterfaceState don't expect nil.

LinkChangeLogLimiter, used by magicsock, subscribed to the static
Monitor's nil event bus client and panicked. Static monitors never
publish link changes, so skip the subscription.

Updates #22412

Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: Ifa826c8cbac6a82b8a15f57bc8178b364fc30e54
2026-11-15 18:14:23 -08:00
Brad Fitzpatrick 167d05bc82 net/netns: honor ALL_PROXY when netns is disabled
netns.SetEnabled(false) is for processes like userspace-only clients
whose traffic never routes back into themselves, so they don't need
the namespace setup. But FromDialer also skipped the ALL_PROXY SOCKS
wrapping when disabled, so such processes couldn't reach the internet
in environments that only allow egress via a proxy, such as ChatGPT
Work's sandbox.

Only skip the namespace setup when disabled, and still wrap the dialer
for the proxy.

Updates #22412

Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: Ic2023a329c640a1e8de32b157ed608ba385000a1
2026-11-15 18:14:08 -08:00
Yunus Emre Karaman a6baab333a net/memnet: implement CloseRead and CloseWrite
tcpproxy propagates a backend's close to the client by calling CloseWrite
on the source connection. connHalf did not implement it, so the call was a
no-op and the client never saw EOF. TestTCPRoundRobinHandler only unblocked
the proxy's remaining copy goroutine by writing more data after the first
echo. When the backend closed with that data still buffered in the pipe,
the write was discarded and the test hung until the 10 minute timeout.

Implement both halves of the half-close contract on connHalf. A new test
covers buffered data surviving CloseWrite, EOF on the read after it, and
writes failing after CloseRead.

Fixes #17533

Signed-off-by: Yunus Emre Karaman <[email protected]>
2026-11-15 10:35:58 -08:00
Yunus Emre Karaman daf82a50f0 prober: deflake TestHTTPBandwidth on coarse-clock machines
The test asserts that a successful probe records a positive transfer
time, but the transfer is shorter than one clock tick on the Windows CI
runner: four attempts at 1 MiB plus their connection setups took 2.3ms
in total, yet every measurement read exactly 0, so the retry loop added
in #20214 just re-measured zero and then failed with
"http_bw_transfer_time_seconds_total = 0 after 4 attempts".

A 1 MiB loopback transfer takes ~0.4ms here, so no payload small enough
for a unit test is reliably measurable against a millisecond-coarse
clock. Make the transfer span more than one tick instead: /download now
writes half the payload, flushes, sleeps 50ms, then writes the rest.
The probe measures ~52ms, so the >0 assertion holds deterministically
and the retry loop can be deleted.

Fixes #21620

Signed-off-by: Yunus Emre Karaman <[email protected]>
2026-11-15 07:58:54 -08:00
Dep Updater 9d5313662a go.mod: bump golang.org/x/sys
* golang.org/x/sys: v0.49.0 to v0.50.0

Triggered by @bradfitz via the bumpdep workflow.

Updates #22390

Change-Id: I402717314704a7f7b164a15e073608ef9dcc31fb
Signed-off-by: Dep Updater <[email protected]>
2026-11-14 09:50:33 -08:00
Brad Fitzpatrick 0d822c9d3a cmd/testwrapper, .github/workflows: bound hung CI test jobs
A burst of PR pushes on 2026-11-13 left several GitHub-hosted test
shards sitting in "test all" for hours after their disks filled up,
holding hosted runner slots until GitHub's 6 hour job limit. Nothing
bounded them: go test's -timeout only limits a test binary while it
runs, not compiling and linking it, and test.yml set no job timeouts.

Give every test.yml job a timeout-minutes of roughly twice the slowest
successful run seen across ~1200 recent jobs.

In testwrapper, kill go test if it goes quiet for longer than any
single test binary may run (the go test -timeout plus a 5 minute
margin, overridable via TS_TESTWRAPPER_IDLE_MARGIN) and log the
process tree under testwrapper so the stuck process is visible.
Also bound the go list and listpkgs invocations and each retry
attempt, including its rebuild.

While here, fix testwrapper exiting 0 when go test was killed by a
signal (exit code -1) with no failed tests recorded.

Updates tailscale/corp#51500

Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: I52bd41c247fca157d8e56381319fe80ae2f7cf02
2026-11-13 16:30:16 -08:00
Joe Tsai 09d54b6ce2 logtail: add support for authenticated log uploads (#20482)
Control via nodecap.LogUploadAuth may notify the node
that there is an authorization token to use when uploading logs.
If specified, then the logtail.Logger will use that token
when uploading.

Unfortunately, there is a time-of-use and time-of-check discrepancy
that complicates logging. When logs are written under the context
of being for a particular node, we cannot store the token,
as it may be invalid by the time that the logs are uploaded.

Instead, we add Logger.SetAuthID to annotate subsequent log entries
with an identifier for the token to later use.
Only when we upload do we strip out the auth ID, lookup the
auth token to use, and then perform the upload.

We assume that control will notify the client of new tokens
well before they expire. Fetching a refreshed token
is not the job of the client.

Updates tailscale/corp#39092

Signed-off-by: Joe Tsai <[email protected]>
2026-11-13 16:01:46 -08:00
Nick Khyl 027c2a8253 clientupdate: stop requesting the -winui MSI variant on Windows
The Windows installers no longer come in a separate -winui variant.
Remove the temporary qualifier.

Updates tailscale/corp#50987

Signed-off-by: Nick Khyl <[email protected]>
2026-11-13 15:47:32 -08:00
Brad Fitzpatrick 283569e707 derp/derpserver: fix data race on sclient.keepAliveTimer
run assigned keepAliveTimer after AfterFunc had already armed it, and
the timer's func uses the field (writePending resets it), so nothing
ordered the assignment before the first keepalive. Assign it first and
arm it with Reset, which does.

No existing test ran long enough for a keepalive to fire. The new
TestKeepAlive waits for three under synctest; with the race detector it
fails without this fix.

Updates #13038

Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: I8f2c4e6a1b3d5f7091a2c3e4d5f6a7b8c9d0e1f2
2026-11-13 15:03:21 -08:00
Andy TianandClaude Opus 5.5 e0d532cca9 ipn/ipnlocal: don't write a netmap cache without CacheNetworkMaps (#22335)
onHomeDERPUpdateLocked wrote the netmap cache without checking the
CacheNetworkMaps capability, unlike the full netmap and peer delta
paths. On a node without it, each home DERP change recreated a cache
with no peers, and the next start went Running from it before control
sent any peers.

Check the capability before that write. A cache written before this
fix can still be loaded once; the first netmap from control without
the capability then discards it.

Fixes #22334

Change-Id: I2f49a6617e6756e36316605995b171f6d7b3ff28

Signed-off-by: Andy Tian <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-13 10:05:07 -05:00
Claus Lensbøl c687660ac5 ipn/ipnlocal{,/netmapcache}: extract file store in prep for new stores (#22266)
The filestore was the only implemented store but we want to be able to
add other stores depending on the platform.

Make space for compiling on more stores, though keep the file store as
the default option.

Updates #22265

Signed-off-by: Claus Lensbøl <[email protected]>
2026-11-13 09:51:10 -05:00
Joe Tsai 59064619a0 ipn/ipnlocal: add stub for LocalBackend.SetLogUploader (#22375)
This is needed for authenticated log uploads (see #20482).
Add a noop declaration now, so that we can call it from
client implementations on other platforms (e.g., Android or iOS).

Updates tailscale/corp#39092

Signed-off-by: Joe Tsai <[email protected]>
2026-11-12 18:00:38 -08:00
chaosinthecrd 1d32249f40 cmd/k8s-proxy: add test for parsePort
Updates #21714

Signed-off-by: chaosinthecrd <[email protected]>
2026-11-12 22:40:34 +00:00
chaosinthecrd 7ce5547382 cmd/k8s-proxy: listen on the PORT that the operator sets
For kube-apiserver ProxyGroups with static endpoints, the operator sets
PORT on the k8s-proxy container to the targetPort of the NodePort
Services behind the advertised endpoints. k8s-proxy never read PORT, so
tsnet listened on a random port and traffic to the static endpoints was
forwarded to a port with nothing listening. Peers stayed on DERP.

This fixes this by parsing PORT and setting it as tsnet.Server.Port.
Thanks to @icheishvili (#18841) and @rquitales (#21716), whose changes
this is based on.

Updates #21714

Signed-off-by: chaosinthecrd <[email protected]>
2026-11-12 22:40:34 +00:00
Fran Bull 36d2564bd4 ipn/ipnlocal: add hook to peerapi dns response
to allow headers to be added. To enable feature/conn25 to add a header.

Updates tailscale/corp#46169

Signed-off-by: Fran Bull <[email protected]>
2026-11-12 13:49:18 -08:00
kari-ts 11c8208450 util/syspolicy, docs/windows: support checkbox based string list (#22023)
policies

This adds support for reading string-list policies represented as
DWORD-backed registry subkeys. Each nonzero DWORD contributes its value
name to the resulting string list, allowing group policy settings to
expose predefined options as checkboxes instead of requiring users to
enter strings manually.

This also adds definitions for HiddenNetworkDevices.

Updates tailscale/corp#50029

Signed-off-by: kari <[email protected]>
2026-11-12 13:24:42 -08:00
Fran Bull e982a66c01 ipn/ipnstate,tailcfg: fix comment
The comment should refer to dbx.Node.IsRouter, not
dbx.Node.IsSubnetRouter.

Updates #cleanup

Signed-off-by: Fran Bull <[email protected]>
2026-11-12 13:24:06 -08:00
François Marier 3631dae2d8 tstest/natlab/vnet: check PCP nonces in renewals and deletes (#22370)
PCP requests with an incorrect nonce are ignored by PCP servers
which follow the simple threat model defined in RFC 6887. Doing
it in natlab will ensure we detect client regressions.

Updates #21127

Change-Id: Ifefcda278800f642c161df90e76babeb089da5a3
Signed-off-by: Francois Marier <[email protected]>
2026-11-12 14:22:14 -07:00
kari-ts 7109040a7d ipn/ipnlocal: handle lagging watchers on policy changes (#22313)
This uses the same notification delivery logic for policy changes and regular ipn bus updates. Previously, sysPolicyChangedForSession silnetly dropped policy notifications when a watcher's channel was full, potentially leaving clients with stale policy and gui visibility state. Now lagging watchers follow the existing block, suspend, or close behavior, allowing them to recover the latest policy when they resume or reconnect.

Updates tailscale/corp#44104

Signed-off-by: kari-ts <[email protected]>
2026-11-12 12:58:52 -08:00
Nick Beirne 254cb9a426 wgengine/magicsock: retry all UDP read errors with a delay
tailscale/wireguard-go#116 changed the receive loop to retry any errors
other than net.ErrClosed without a delay. magicsock entered a spin loop
if it encountered a UDP read error.

magicsock's receive funcs now return only net.ErrClosed when the socket
actually closes. Every other read error is counted, logged, and retried
after a short delay. IsUDPReadFeedback and IsUDPReadUnknown are removed
because they can be handled like any other error.

Retrying errors may hide failures which used to stop the receive func.
- There is a new metric magicsock_recv_udp_error which counts all read
  errors.
- After 30s of continuous errors, the receive function marks itself as
  broken. A warning is raised until a read succeeds.

Updates #22097

Change-Id: Ib9ade0ed001e413205eb7d452aa108aae574e0d1
Signed-off-by: Nick Beirne <[email protected]>
2026-11-12 15:46:56 -05:00
chaosinthecrd a785baba6e feature/acme: test retrying renewal order without ARI replaces
Adds a test that issueACMECert, against tstest/acmetest, retries an
order naming "replaces" once without it when the CA rejects it, and
stores the cert from the retried order. It also checks that rate limits
and server errors are not retried, and that the error from the plain
order is returned if that is rejected too.

Updates #22042

Signed-off-by: chaosinthecrd <[email protected]>
2026-11-12 19:34:44 +00:00
chaosinthecrd 4fad6e5a3b feature/acme: retry renewal order without ARI replaces if rejected
When a previous cert exists, the renewal order names it in the ARI
"replaces" field. Let's Encrypt rejects that order if the current ACME
account did not issue the cert, which is the case once the account key
has been recreated but the cert kept (for example after
acme-account.key.pem is deleted), so renewal fails until the cert
expires or is deleted. This fixes this by retrying the order once
without "replaces" when the CA rejects it, unless it was rate limited.
The new cert belongs to the current account, so later renewals use
"replaces" again.

Fixes #22042

Signed-off-by: chaosinthecrd <[email protected]>
2026-11-12 19:34:44 +00:00
chaosinthecrd 071bf947c0 k8s-operator/api-proxy: add test for whoIs
Adds a test that checks whoIs gets the identity from the request's remote
address, and returns an error instead of using the X-Forwarded-For header
when the remote address is not a tailnet node.

Updates tailscale/corp#51000

Signed-off-by: chaosinthecrd <[email protected]>
2026-11-12 17:21:23 +00:00
chaosinthecrd 85cbfeef38 k8s-operator/api-proxy: only use the remote address for WhoIs
whoIs fell back to the X-Forwarded-For header when WhoIs on the request's
remote address failed (only when serving over plain HTTP, as cmd/k8s-proxy
does). That header comes from the client, so the identity could come from
the request instead of the connection. This fixes this by removing the
fallback, so whoIs only uses the connection's remote address. It also asks
for TCP only, as the proxy only serves TCP, so a miss does not also try UDP.

Updates tailscale/corp#51000

Thank you Emilio Mendoza @a3l6 for reporting

Signed-off-by: chaosinthecrd <[email protected]>
2026-11-12 17:21:23 +00:00