Commit Graph
11695 Commits
Author SHA1 Message Date
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 <fran@tailscale.com>
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 <francois@tailscale.com>
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 <kari@tailscale.com>
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 <nickb@tailscale.com>
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 <tom@tmlabs.co.uk>
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 <tom@tmlabs.co.uk>
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 <tom@tmlabs.co.uk>
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 <tom@tmlabs.co.uk>
2026-11-12 17:21:23 +00:00
Alex Valiushko 2e6fcb4f60 tstun,wgengine: open multiple TUN and UDP queues (#22188)
Open up to 16 parallel I/O queues, further capped at GOMAXPROCS.

TS_DEBUG_MAX_QUEUES can be used to override the above. 

Following was captured on a c8gn.24xlarge server peering with 16
c8gn.xlarge clients. Ubuntu 24.04, kernel v6.14, loaded with a single
iperf3 thread.

   TX
       peers  build         Gb/s  vs stock   cores  cores/Gbps
           1  stock         4.48        --    2.35       0.524
              branch        4.48       -0%    2.38       0.531
           4  stock        11.62        --    4.95       0.426
              branch       18.61      +60%    7.93       0.426
          16  stock        11.51        --    5.18       0.450
              branch       22.97     +100%   14.05       0.612

   RX
           1  stock         4.53        --    2.74       0.605
              branch        4.53       -0%    2.70       0.596
           4  stock         9.06        --    4.65       0.513
              branch       18.47     +104%    9.72       0.526
          16  stock         8.63        --    4.81       0.558
              branch       42.87     +397%   28.10       0.655


Updates tailscale/corp#48168
Updates tailscale/corp#37878

Change-Id: Id3db86038a5f08eb8e84a42c6622463ba50e3f3c

Signed-off-by: Alex Valiushko <alexvaliushko@tailscale.com>
2026-11-12 09:08:37 -07:00
Matt Van Horn ddb3fd6b43 retire stale TSMP disco key after peer restart (#22232)
wgengine/magicsock: retire stale TSMP disco key after peer restart

When a nonzero control key replaces an old control key equal to the
active TSMP key, updateDiscoKey clears the TSMP-active flag and
subsequent sends use the new control key, while the retired TSMP
material stays stored. A zero control key falls back to the TSMP key as
active, and a different TSMP key that is already active stays preferred.
Each compare-and-swap attempt allocates a fresh disco snapshot before
choosing the active key.

Fixes #22201

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-11-12 09:27:55 -05:00
Aniket e3ecbb9894 tstime: fold fractional ParseDuration cases into TestParseDuration
Updates #21552

Signed-off-by: Aniket <aniketkomailkro@gmail.com>
2026-11-12 09:18:45 +00:00
Aniket 5e444c9f32 tstime: reject fractional day and week values in ParseDuration
ParseDuration rewrites the digits before a d or w unit as hours, but only
looked at the digits after the decimal point, so 0.5d quietly returned
7m12s. Return an error for fractional day and week values instead.

Fixes #21552

Signed-off-by: Aniket <aniketkomailkro@gmail.com>
2026-11-12 09:18:45 +00:00
Kristoffer Dalby a2da5fbcaa tsnet: add Server.SystemDial
Lets an embedder pick the dialer for non-tailnet connections, such
as to control. When control runs in the same process, the node can
then reach it in memory (e.g. memnet) instead of via loopback.

Updates tailscale/corp#27636

Signed-off-by: Kristoffer Dalby <kristoffer@dalby.cc>
2026-11-12 10:15:41 +01:00
James Tucker 7b2c32b913 net/netns: compose caller ControlContext with namespace setup
Prepare for shared socket policy for DERP, control, and log uploads.
Callers need to configure options such as TCP user timeout on the same
socket that netns configures to avoid routing loops.

Use ControlContext for dialer namespace setup and run any caller-supplied
ControlContext afterward, only if namespace setup succeeds. Reject a
non-nil Control unconditionally with a panic directing callers to
ControlContext, including when netns is disabled, rather than support
both hook types and their precedence rules. Listener Control hooks
remain unchanged.

Existing in-tree FromDialer callers supply neither hook, so no caller
migration is required. Keep socket defaults and proxy-wrapping behavior
unchanged. Test hook ordering, context and argument forwarding, errors,
legacy-hook rejection, disabled mode, and proxy delegation.

Updates tailscale/corp#50948

Change-Id: I9d778273f3257fe8a298463ef29ec2dd5d5fb7b0
Signed-off-by: James Tucker <james@tailscale.com>
2026-11-10 23:01:54 -08:00
Dep Updater c31b4c133d go.toolchain.rev: bump Go toolchain
* Go toolchain: https://github.com/tailscale/go/compare/7ef7b403648ac3a9481a6e88e8b894eff50b0167...1635316a95598e9fe1bff7267604daa94aa1c8ec

Triggered by @bradfitz via the bumpdep workflow.

Updates #22325

Change-Id: I4b9ec7a2d48a94e1d96e99f4c6a26b96f959a05f
Signed-off-by: Dep Updater <noreply+dep-updater@tailscale.com>
2026-11-10 18:14:49 -08:00
Brad Fitzpatrick b8b3208fb3 util/eventbus/eventbuscheck: add whole-program T vs *T event check
The eventbus routes events by exact type, so a subscriber of *T never
sees a T. Add a test that type-checks the module for linux, windows and
darwin and fails if any event type is used with eventbus or
eventbustest both by value and by pointer. To keep memory use down, it
drops function bodies outside the packages that import those. It skips
in race builds because of a go/types data race, golang/go#81122.

Updates #22307

Change-Id: Ia7486c43936f367f8767ad9c8750faa9b6bdf8f0
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-11-10 18:13:02 -08:00
Brad Fitzpatrick cf5e4f8695 health, net/netmon: fix tests that expected eventbus events by pointer
Both tests passed filter funcs taking a pointer to an event type that
is published by value, so the filters never matched. The health test
passed only because Expect timed out, so make it look for the event it
means to forbid.

Updates #22307

Change-Id: I7daf64656cd9b0e9e98372cd803a6e824db96594
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-11-10 18:13:02 -08:00
yaruk-byte 0bda5935f4 tstest/integration: catch tailscaled crashes on the Windows service (#21883)
Fixes #20443

Signed-off-by: Yaruk Asghar <yaruk@tailscale.com>
2026-11-10 18:51:56 -07:00
yaruk-byte 846e948ff5 tstest/integration: add Windows unattended-mode test coverage (#21876)
Updates #20751

Signed-off-by: Yaruk Asghar <yaruk@tailscale.com>
2026-11-10 18:51:07 -07:00
yaruk-byte f5e94327cc tstest/integration: test logging in with the AuthKey system policy (#21809)
Updates #20871

Signed-off-by: Yaruk Asghar <yaruk@tailscale.com>
2026-11-10 18:50:20 -07:00
James Tucker 1f6259a88b derp,control,logtail: add baseline heartbeat and upload metrics
Count DERP keepalive and ping/pong traffic, terminal read-deadline
expirations, and control map-request watchdog expirations. Count
successful pre-compression log upload bytes alongside existing upload
totals to support batch-size comparisons.

Keep timeout attribution narrow: expirations do not imply a successful
reconnect, and completed writes do not imply peer receipt. Log upload
metrics remain on the existing per-logger ExpVar surface.

Add deterministic coverage without changing heartbeat timing, socket
settings, reconnect behavior, or upload policy.

Updates tailscale/corp#50948

Change-Id: I95f7bab62c000172a4825283bb4c055dd29d8043
Signed-off-by: James Tucker <james@tailscale.com>
2026-11-10 16:48:38 -08:00
James Tucker 4ad0fa1bee net,ipn,cmd: migrate dialer hooks to ControlContext
Use ControlContext for production net.Dialer socket hooks:
PeerAPI and debug peer dialing, captive-portal probes, stunstamp TCP
measurements, and the test agent connection.

Update the PeerDialControlFunc callback signature and Apple extension
implementation together with both consumers. Preserve namespace binding,
socket settings, timeout values, and existing error handling. Listener
Control and RawConn.Control are separate APIs and remain unchanged.

Add coverage for platform hook forwarding and errors, debug and captive
portal dialing, cancellation, SO_REUSEADDR, and test-agent hook selection
and keepalive configuration. Cover the Apple missing-interface error and
non-Linux bypass no-op in their platform-specific tests.

Updates tailscale/corp#50948

Change-Id: I4fb162666724f307f2d3d0beba6ed1b0ed15bb4f
Signed-off-by: James Tucker <james@tailscale.com>
2026-11-10 16:47:42 -08:00
Jordan Whited a7befef034 go.mod,wgengine/wgcfg: bump wg-go & configure staged global limit on iOS
https://github.com/tailscale/wireguard-go/compare/79ead109a81a8f57c75ac9e6ddee61714c82744b...9e10ef9af41578baabde0283237d5cbb6422ff25

Start off with device.WithQueueStagedGlobalLimit inheriting the same
value from the knob it replaced, device.WithPreallocatedBuffersPerPool.

Unlike WithPreallocatedBuffersPerPool, WithQueueStagedGlobalLimit is
exclusive of packet memory allocated for transport messages that are
immediately transmitted. So, one must consider
WithQueueStagedGlobalLimit alongside .Queue{In,Out}boundSize to
understand overall memory ceiling impacts.

An approximation of the configured packet memory ceiling on iOS can be
calculated with the following formula:

device.singlePacketSlabSize * ( // 1788
  (2 * device.WithQueueOutboundSize) + // 128
  (2 * device.WithQueueInboundSize) + // 128
  device.WithQueueStagedGlobalLimit // 64
)
=
~572KB

Where previously it was:
device.singlePacketSlabSize * ( // 1788
  device.WithPreallocatedBuffersPerPool // 64
)
=
~114KB

Updates tailscale/tailscale#1971
Updates tailscale/tailscale#21773
Updates tailscale/corp#46396

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2026-11-10 16:45:40 -08:00
François Marier 1ebf217e93 tstest/natlab/vnet: implement portmap deletions (#22302)
Add basic support for the deletion of port mappings in natlab.
NAT-PMP clients are supposed to set the external port to 0 in their
requests, but we test with a bogus port since servers are supposed
to ignore this value.

Note that passing a lifetime of 0 to a UPnP mapping will delete
that mapping (like it's supposed to in PCP/NAT-PMP) instead of
following the spec and turning that into 604800s.

Updates #21713

Change-Id: I487cc0cae1247dff69484658f86a45d278bcdea7
Signed-off-by: Francois Marier <francois@tailscale.com>
2026-11-10 15:58:59 -07:00
Nick Khyl 3bd67a8085 ipn/ipnlocal,logtail,net/netmon: subscribe to eventbus events by value
The eventbus routes events by exact type, and these three subscribers
took a pointer to an event type that is only ever published by value,
so they never ran. logtail could not detect the network coming back up
after an upload failure, LocalBackend never recorded or announced the
latest client version, and the magicsock portmapper log limiter never
reset after a major link change.

Updates #22307

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2026-11-10 13:47:01 -08:00
Brad Fitzpatrick e4825bd0db tstime/mono: add AtomicTime, remove Time.LoadAtomic and StoreAtomic
Time.LoadAtomic and StoreAtomic only worked on 32-bit platforms if
the field happened to be 64-bit aligned, which tstun and magicsock
each guarded with a test. AtomicTime wraps an atomic.Int64, so the
compiler guarantees its alignment, and the tests can go. Also use it
for tstime/rate's Limiter.next, which was an atomic.Int64 holding a
mono.Time.

Updates #cleanup
Updates #22290 (where this was discovered)

Change-Id: I02807906ed9be59446456853bccece6e32e472ed
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-11-10 13:04:27 -08:00
License Updater 3ff72edcd8 licenses: update license notices
Signed-off-by: License Updater <noreply+license-updater@tailscale.com>
2026-11-10 12:39:33 -08:00
Brad Fitzpatrick 5b6c39b94d tstime/rate: deny without locking while a Limiter has no tokens
wgengine/filter asks its accept-logging Limiter about every accepted
packet, so with tailscaled's TUN and UDP queues spread over CPUs
(tailscale/tailscale#22188), that Limiter's mutex took 11% of a subnet
router's CPU on a 128-CPU host, most of it contended. On a denial,
record when the next token is due, and deny before then without taking
the mutex. A denial with a backwards timestamp no longer rewinds the
bucket's last update time, which credited it with tokens it never
earned.

             │      old       │                 new                  │
             │     sec/op     │    sec/op     vs base                │
    AllowN       13.550n ± 0%    1.143n ± 2%  -91.56% (p=0.000 n=10)
    AllowN-8   108.6500n ± 4%   0.1497n ± 4%  -99.86% (p=0.000 n=10)
    geomean       38.37n        0.4137n       -98.92%

Updates #22188

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: I928f64d3df7b51c6cac0da7dafe9ef5e71acaa05
2026-11-10 10:45:13 -08:00
Brad FitzpatrickandFredrik Fornwall 501037640d tsnet: build with minimal feature tags, add test
tsnet called the serve LocalAPI client and LocalBackend methods
unconditionally, so it didn't build with ts_omit_serve, which every
minimal feature set includes. Make those methods return
feature.ErrUnavailable when serve is omitted, as ListenFunnel and
ListenService now do too.

Declare tsnet's minimum feature set (netstack) as
featuretags.TSNetMin, add cmd/featuretags --tsnet to keep it, and add
a test that type-checks tsnet with it and a few other small feature
sets.

Fixes #22282
Updates #22283

Change-Id: I866fa34d052bfd437b1c9d3309063999d7ebb02c
Co-Authored-By: Fredrik Fornwall <fredrik@fornwall.net>
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-11-10 10:17:13 -08:00
kari-ts f6eb3f9dc7 ipn, feature/guivisibility: send incremental gui visibility updates (#22067)
This moves HiddenNetworkDvice policy out of ipnlocal and into an optional ipnext.
This adds a per-session notification hook that uses each watcher's effective policy snapshot to populate NodeGUIVisibility.
A full visibility snapshot is sent on initialization and policy changes, and on subsequent peer updates, only changed peers are evaluated.
The extension populates Notify.NodeGUIVisibility with the hidden peers
among the nodes the Notify covers: all peers when it carries Policy
(initially and on policy change), or the PeersChanged peers otherwise.
Absent means visible, so a Policy-bearing Notify replaces the client's
visibility state and a peer-change Notify updates only the changed peers.
No NodeGUIVisibilityChanges/Removed fields and no per-session node state
are needed: removed peers simply leave the client's peer set, and full
netmap updates already resend every peer alongside SelfChange.

When the feature isn't linked, the hook slice is empty and the fast path
in notifyForSessionLocked is unchanged. When the policy isn't configured,
the hook costs a snapshot lookup per session per Notify and sends nothing.

Updates tailscale/corp#44104

Signed-off-by: kari <kari@tailscale.com>
Signed-off-by: Nick Khyl <nickk@tailscale.com>
2026-11-10 10:05:32 -08:00
chaosinthecrd 408f0d2b36 ipn,feature/acme,client/local: add tests for the cert-status localapi endpoint
Tests that the localapi cert-status/ handler checks read access and returns
the status as JSON, that LocalBackend.CertStatus goes through the hook, and
that feature/acme's hook reports the same missing, valid and expired results
as the C2N /tls-cert-status handler. Also tests that Client.CertStatus
returns ErrCertStatusUnsupported for a 404 and not for other errors.

Updates tailscale/corp#38175

Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>
2026-11-10 17:37:53 +00:00
chaosinthecrd a986bbfac2 ipn,feature/acme,client/local: add a read-only cert-status localapi endpoint
The localapi cert/ endpoint fetches a cert when none is cached, so polling it
triggers issuance. feature/acme can already report a cached cert without
contacting the CA, but only over the C2N /tls-cert-status path. This moves
that check into an extension method and serves it as localapi cert-status/,
with a matching Client.CertStatus, reporting Missing on a cache miss instead
of issuing. Client.CertStatus returns ErrCertStatusUnsupported (wrapping
errors.ErrUnsupported) when tailscaled has no cert-status endpoint.

Updates tailscale/corp#38175

Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>
2026-11-10 17:37:53 +00:00
dependabot[bot] 05930082da build(deps-dev): bump vite from 6.4.5 to 6.4.6 in /client/web
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.4.5 to 6.4.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.4.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.4.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.4.3
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-10 09:56:08 -07:00
Mazdak Nasab ad8bad6114 feature/conn25: make client flow cleanups idempotent (#22280)
The cleanup returned by flowCreated decremented activeFlowCount on every
call, and its documented contract pushed the burden of calling it exactly
once onto the datapath. A caller that lost track and ran a cleanup twice
would undercount the flows still forwarding over the assignment, letting
popExpired reclaim both of its addresses back to the pools mid-connection,
or drive the count to -1, which can never again satisfy popExpired's
zero-flow test and so pins the assignment in the expiry heap and leaks
both addresses for the life of the process.

The cleanup now releases its hold at most once, guarded by a bool read and
written under c.mu alongside the decrement it protects. Repeat calls are
no-ops. The Conn25Datapath docs no longer ask callers to guarantee this.

No such double-call is reachable through FlowTable today: removeFlowLocked
deletes both cache entries, so NewFlow's second lookup misses, and the
capacity eviction takes lru.Back(), never the flow just pushed to the
front. This removes the class rather than a live bug.

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

Change-Id: I1888f36eb8fdec9b219ccfd2d290dc4eb19c55a0

Signed-off-by: Mazdak Nasab <mazdak.nasab@gmail.com>
2026-11-10 09:19:22 -07:00
Brad Fitzpatrick 444baf1ef5 ipn: make ServeConfig.IsFunnelOn false in ts_omit_serve builds
Funnel can't be on without serve. With the HasServe check, the
compiler reduces the method to a constant and inlines it, so the
linker drops it from those builds.

Updates #22283

Change-Id: Idd5da9c1e4f8f41a828a3774f5c4d44872eb1dda
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-11-10 07:24:48 -08:00
Fredrik Fornwall b9d5ff3ae7 ipn/ipnlocal: don't apply netmap from a replaced control client
setControlClientStatusLocked releases b.mu around tkaSyncIfNeeded. If
Logout replaced the control client meanwhile, the old client's netmap
was applied to the new profile, leaving it Stopped with the old IPs.

Fixes #22274

Change-Id: If4e9fdd5477db7f97b0362c5632c280dba4c18f5
Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
2026-11-10 07:10:18 -08:00
Gabriel von Winckler 9476be9403 release/dist/unixpkgs: set file modes explicitly in deb and rpm packages (#22203)
The deb and rpm contents set no mode, so nfpm copied each file's mode
from the source file on disk and the result depended on where the build
ran. Since the release logic moved to OSS in fc4b25d9 (2023-02), corp
builds read the configs and systemd units from the read-only Go module
cache and ship them as 0444, where 1.36 shipped 0644. A checkout with
umask 002 instead gives group-writable 0664 files and 0775 binaries.

Set the modes explicitly, as the tarballs already do: 0755 for the
binaries and 0644 for the systemd units and /etc/default/tailscaled.
Configs return to 0644; binaries are unchanged.

Tested by building the amd64 deb and rpm under umask 002 and 022 and
checking the modes with dpkg-deb -c and rpm -qplv; package metadata is
otherwise unchanged.

Fixes #22202

Change-Id: I14acbd075b2f680720fdec47ce5e4e6033c363f7

Signed-off-by: Gabriel von Winckler <gabriel@tailscale.com>
2026-11-10 10:39:16 +00:00
Brad Fitzpatrick d566ac8ac9 ipn/ipnlocal, feature/acme: fix ts_omit_serve build with acme
feature/acme uses LocalBackend.ServeConfig to find hostnames needing
cert refresh, which broke builds with ts_omit_serve but not
ts_omit_acme. The serveConfig field it reads exists in all builds, so
move the method out of the serve-only file rather than making acme
depend on serve, and skip the refresh loop hook when serve is omitted
so the linker can drop it.

Updates #22283

Change-Id: I2cef6683cd6e6144306ddec95255d606f7a539ae
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-11-09 16:12:07 -08:00
Brad Fitzpatrick f49c53f166 util/clientmetric: add NewGaugeFunc and DisableDeltas omit stubs
net/sockstats uses both on darwin, ios, and android, so those builds
failed with ts_omit_clientmetrics.

Updates #22283

Change-Id: Ib242334dbcba639603fbf57a3b016efdecaea3d5
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-11-09 16:09:45 -08:00
Mazdak Nasab 7ed0138541 feature/conn25: match client flow removals to the assignment they counted (#22142)
flowRemoved identified an address assignment by transit IP alone, but a
transit IP does not identify an assignment for the lifetime of a flow.
An assignment can be dropped while a flow created against it is still in
the client flow table, and the pools then hand the same transit IP back
out to an unrelated assignment. The stale removal was charged to that
stranger, dropping its activeFlowCount while its own flows were still
forwarding, so popExpired reclaimed both of its addresses back to the
pools mid-connection. If the stranger had no flows of its own the count
went to -1, which can never again satisfy popExpired's zero-flow test,
pinning it in the expiry heap and leaking both addresses for the life of
the process.

flowCreated now returns a function, which the datapath calls on removal
to clean up the flow.

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

Change-Id: I3693c487b1031737763b5e49f8f8400c72848e8e

Signed-off-by: Mazdak Nasab <mazdak.nasab@gmail.com>
2026-11-09 15:23:33 -07:00
Mazdak Nasab 6372b9a43a feature/conn25: shut the address assignment queue down from the sender side (#22269)
extension.Shutdown closed client.addrsCh, but the hooks that feed that
channel are still live at that point. LocalBackend.shutdown shuts the
extension host down before closing the engine, and nothing unregisters
what installHooks registered on the DNS manager and the tun device, so a
DNS response arriving during the shutdown window still reaches
mapDNSResponse -> rewriteDNSResponse -> reserveAddresses ->
enqueueAddressAssignment, and sends on the closed channel. That's a
panic, not a dropped assignment.

Every send already happens under c.mu, so the client can shut its own
queue down: client.shutdown takes the lock, sets a closed flag and
drains the queue, and enqueueAddressAssignment refuses with
errClientShutdown from then on.

A late DNS response now fails the reservation instead of queueing it for
a sendLoop that is gone. reserveAddresses rolls back, returning the
magic and transit IPs to their pools, and the query servfails rather
than being answered with a magic IP that no connector will ever hear
about.

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

Change-Id: I712ba8493e77b8176e133decc6097efb52b1b4ab

Signed-off-by: Mazdak Nasab <mazdak.nasab@gmail.com>
2026-11-09 13:37:58 -07:00
dependabot[bot] 1e2c689b6b build(deps): bump @babel/core from 7.23.3 to 7.29.13 in /client/web
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.23.3 to 7.29.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.29.13/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-version: 7.29.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-09 13:29:48 -07:00
dependabot[bot] f33f387639 build(deps): bump form-data from 4.0.4 to 4.0.6 in /client/web
Bumps [form-data](https://github.com/form-data/form-data) from 4.0.4 to 4.0.6.
- [Changelog](https://github.com/form-data/form-data/blob/master/CHANGELOG.md)
- [Commits](https://github.com/form-data/form-data/compare/v4.0.4...v4.0.6)

---
updated-dependencies:
- dependency-name: form-data
  dependency-version: 4.0.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-09 13:21:23 -07:00
dependabot[bot] ab3d3b18d5 build(deps-dev): bump vite from 5.4.21 to 6.4.5 in /client/web
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.21 to 6.4.5.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.4.5/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.4.5/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.4.4
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-09 13:05:16 -07:00
dependabot[bot] 2bd6251010 build(deps): bump lodash from 4.17.23 to 4.18.1 in /client/web
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.23 to 4.18.1.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.23...4.18.1)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.18.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-09 13:04:42 -07:00
dependabot[bot] d5012e6983 build(deps): bump nanoid from 3.3.11 to 3.3.18 in /client/web
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.11 to 3.3.18.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/3.3.18/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.11...3.3.18)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-version: 3.3.18
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-09 12:46:44 -07:00
dependabot[bot] 30e6fee5af build(deps): bump browserslist from 4.22.1 to 4.28.8 in /client/web
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.22.1 to 4.28.8.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.22.1...4.28.8)

---
updated-dependencies:
- dependency-name: browserslist
  dependency-version: 4.28.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-09 12:46:28 -07:00
dependabot[bot] f79cb91562 build(deps): bump js-yaml from 4.1.1 to 4.3.2 in /client/web
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.1 to 4.3.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.2/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.1...4.3.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-09 12:45:32 -07:00
dependabot[bot] 8fbc196681 build(deps): bump source-map-js from 1.2.1 to 1.2.2 in /client/web
Bumps [source-map-js](https://github.com/7rulnik/source-map-js) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/7rulnik/source-map-js/releases)
- [Changelog](https://github.com/7rulnik/source-map-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/7rulnik/source-map-js/compare/v1.2.1...v1.2.2)

---
updated-dependencies:
- dependency-name: source-map-js
  dependency-version: 1.2.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-09 12:45:17 -07:00
kari-ts 211f737bb4 ipn/ipnlocal: add shared login bootstrap orchestration (#21857)
Apple and Android both implement their own login orchestration, coordinating preference updates, backend startup, and interative login. This requires the clients to understand details about the backend lifecycle and has led to duplicated logic and ordering issues.

Android needs to avoid setting WantRunning=true via EditPrefs before calling Start, because doing so triggers Login on the existing control client, which Start then tears down, potentially canceling an in-flight registration before an authentication URL is returned (see https://github.com/tailscale/tailscale-android/commit/83057865e13b8f116a0871a3c6d6adf46f5c3d32). Apple has similar orchestration, including separate handling for auth keys, custom control servers, and reauth.

This adds a LocalBackend helper that accepts optional masked prefs and an auth key, prepares the desired startup prefs, and initiates or resumes auth. This avoids unnecessary control client resets, preserves the existing control client and auth url when the login configuration hasn't changed, and ensures WantRunning is applied as part of Start when restarting the backend. This can be used for:
-first time login with a custom control url or auth key
-resuming an existing interactive login without losing auth url
-retrying login without unnecessarily resetting the control client
-reauth without restarting the backend

A followup will expose this through localapi.

Updates tailscale/tailscale#18304

Signed-off-by: kari-ts <kari@tailscale.com>
2026-11-09 11:34:27 -08:00