9226 Commits

Author SHA1 Message Date
Simon Law
49ae66c10c
cmd/tailscale: clean up dns --help messages (#16306)
This patch contains the following cleanups:

1. Simplify `ffcli.Command` definitions;
2. Word-wrap help text, consistent with other commands;
3. `tailscale dns --help` usage makes subcommand usage more obvious;
4. `tailscale dns query --help` describes DNS record types.

Updates #cleanup

Signed-off-by: Simon Law <sfllaw@tailscale.com>
2025-06-17 20:39:59 -07:00
Juan Francisco Cantero Hurtado
cbc14bd3b0 ipn: add missing entries for OpenBSD
Signed-off-by: Juan Francisco Cantero Hurtado <jfch@30041993.xyz>
2025-06-17 17:53:22 -07:00
Percy Wegmann
4431fb89c2 ipn/ipnlocal: add some verbose logging to taildrive peerapi handler
Updates tailscale/corp#29702

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-06-17 17:01:36 -05:00
Brad Fitzpatrick
939355f667 tool/gocross: put the synthetic GOROOTs outside of the tsgo directory
We aim to make the tsgo directories be read-only mounts on builders.

But gocross was previously writing within the ~/.cache/tsgo/$HASH/
directories to make the synthetic GOROOT directories.

This moves them to ~/.cache/tsgoroot/$HASH/ instead.

Updates tailscale/corp#28679
Updates tailscale/corp#26717

Change-Id: I0d17730bbdce3d6374e79d49486826575d4690af
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-17 10:09:15 -07:00
Mike O'Driscoll
e7f5c9a015
derp/derphttp: add error notify for RunWatchConnectionLoop (#16261)
The caller of client.RunWatchConnectionLoop may need to be
aware of errors that occur within loop. Add a channel
that notifies of errors to the caller to allow for
decisions to be make as to the state of the client.

Updates tailscale/corp#25756

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
2025-06-17 13:05:05 -04:00
Brad Fitzpatrick
d37e8d0bfa .github/workflows: remove redundant work between staticcheck jobs
Make the OS-specific staticcheck jobs only test stuff that's specialized
for that OS. Do that using a new ./tool/listpkgs program that's a fancy
'go list' with more filtering flags.

Updates tailscale/corp#28679

Change-Id: I790be2e3a0b42b105bd39f68c4b20e217a26de60
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-17 07:37:10 -07:00
Brad Fitzpatrick
42f71e959d prober: speed up TestCRL ~450x by baking in some test keys
Fixes #16290
Updates tailscale/corp#28679

Change-Id: Ic90129b686779d0ed1cb40acf187cfcbdd39eb83
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-16 19:47:02 -07:00
Irbe Krumina
d7770d2b81 .github/workflows: test that ./go/tool version matches go mod version
Tests that go mod version matches ./tool/go version.
Mismatched versions result in incosistent Go versions being used i.e.
in CI jobs as the version in go.mod is used to determine what Go version
Github actions pull in.

Updates #16283

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2025-06-16 15:04:10 -07:00
Irbe Krumina
077d52b22f .github/workflows: removes extra '$'
Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2025-06-16 15:04:10 -07:00
Brad Fitzpatrick
5b086cd2ad tool/gocross: make gocross opt-in instead of opt-out
gocross is not needed like it used to be, now that Go does
version stamping itself.

We keep it for the xcode and Windows builds for now.

This simplifies things in the build, especially with upcoming build
system updates.

Updates tailscale/corp#28679
Updates tailscale/corp#26717

Change-Id: Ib4bebe6f50f3b9c3d6cd27323fca603e3dfb43cc
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-16 14:38:16 -07:00
Brad Fitzpatrick
259bab9bff scripts/check_license_headers.sh: delete, rewrite as a Go test
Updates tailscale/corp#29650

Change-Id: Iad4e4ccd9d68ebb1d1a12f335cc5295d0bd05b60
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-16 13:35:38 -07:00
James Tucker
86985228bc cmd/natc: add a flag to use specific DNS servers
If natc is running on a host with tailscale using `--accept-dns=true`
then a DNS loop can occur. Provide a flag for some specific DNS
upstreams for natc to use instead, to overcome such situations.

Updates #14667

Signed-off-by: James Tucker <james@tailscale.com>
2025-06-16 13:05:49 -07:00
James Sanderson
735f15cb49 util/must: add Get2 for functions that return two values
Updates #cleanup

Signed-off-by: James Sanderson <jsanderson@tailscale.com>
2025-06-16 19:08:58 +01:00
Fran Bull
3d6e1171c1 tsconsensus: protect from data race
lock for access to a.peers

Fixes #16284

Signed-off-by: Fran Bull <fran@tailscale.com>
2025-06-16 10:31:51 -07:00
Nick Khyl
866614202c util/eventbus: remove redundant code from eventbus.Publish
eventbus.Publish() calls newPublisher(), which in turn invokes (*Client).addPublisher().
That method adds the new publisher to c.pub, so we don’t need to add it again in eventbus.Publish.

Updates #cleanup

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2025-06-16 11:46:28 -05:00
Brad Fitzpatrick
5b7cf7fc36 .github/workflows: do a go mod download & cache it before all jobs
Updates tailscale/corp#28679

Change-Id: Ib0127cb2b03f781fc3187199abe4881e97074f5f
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-16 09:04:31 -07:00
Jordan Whited
8e6f63cf11
ipn/ipnlocal,wgengine/magicsock: use eventbus for node & filter updates (#16271)
nodeBackend now publishes filter and node changes to eventbus topics
that are consumed by magicsock.Conn

Updates tailscale/corp#27502
Updates tailscale/corp#29543

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-06-16 08:42:09 -07:00
Anton Tolchanov
42da161b19 tka: reject removal of the last signing key
Fixes tailscale/corp#19447

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2025-06-16 15:38:37 +01:00
dependabot[bot]
59fab8bda7
.github: Bump github/codeql-action from 3.28.19 to 3.29.0 (#16287)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.19 to 3.29.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](fca7ace96b...ce28f5bb42)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 08:02:26 -06:00
Irbe Krumina
e29e3c150f
cmd/k8s-operator: ensure that TLS resources are updated for HA Ingress (#16262)
Ensure that if the ProxyGroup for HA Ingress changes, the TLS Secret
and Role and RoleBinding that allow proxies to read/write to it are
updated.

Fixes #16259

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2025-06-16 12:21:59 +01:00
Nick Khyl
733bfaeffe ipn/ipnlocal: signal nodeBackend readiness and shutdown
We update LocalBackend to shut down the current nodeBackend
when switching to a different node, and to mark the new node's
nodeBackend as ready when the switch completes.

Updates tailscale/corp#28014
Updates tailscale/corp#29543
Updates #12614

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2025-06-13 17:58:21 -05:00
M. J. Fromberger
fe391d5694
client/local: use an iterator to stream bus events (#16269)
This means the caller does not have to remember to close the reader, and avoids
having to duplicate the logic to decode JSON into events.

Updates #15160

Change-Id: I20186fabb02f72522f61d5908c4cc80b86b8936b
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2025-06-13 15:47:35 -07:00
Nick Khyl
6a4d92ecef ipn/ipnlocal: replace nodeContext with nodeBackend in comments
We renamed the type in #15866 but didn't update the comments at the time.

Updates #cleanup

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2025-06-13 14:53:08 -05:00
Andrew Lytvynov
dac00e9916
go.mod: bump github.com/cloudflare/circl (#16264)
See https://github.com/cloudflare/circl/security/advisories/GHSA-2x5j-vhc8-9cwm

This dependency is used in our release builder indirectly via
3b22d8539b/go.mod (L6)
We should not be affected, since this is used indirectly for pgp
signatures on our .deb releases, where we use only trusted inputs.

Updates #cleanup

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2025-06-13 11:30:55 -07:00
James Tucker
923bbd696f prober: record DERP dropped packets as they occur
Record dropped packets as soon as they time out, rather than after tx
record queues spill over, this will more accurately capture small
amounts of packet loss in a timely fashion.

Updates tailscale/corp#24522

Signed-off-by: James Tucker <james@tailscale.com>
2025-06-13 11:06:21 -07:00
James Tucker
9206e766ed net/packet: cleanup IPv4 fragment guards
The first packet fragment guard had an additional guard clause that was
incorrectly comparing a length in bytes to a length in octets, and was
also comparing what should have been an entire IPv4 through transport
header length to a subprotocol payload length. The subprotocol header
size guards were otherwise protecting against short transport headers,
as is the conservative non-first fragment minimum offset size. Add an
explicit disallowing of fragmentation for TSMP for the avoidance of
doubt.

Updates #cleanup
Updates #5727

Signed-off-by: James Tucker <james@tailscale.com>
2025-06-13 11:06:02 -07:00
James Tucker
b0f7b23efe net/netcheck: preserve live home DERP through packet loss
During a short period of packet loss, a TCP connection to the home DERP
may be maintained. If no other regions emerge as winners, such as when
all regions but one are avoided/disallowed as candidates, ensure that
the current home region, if still active, is not dropped as the
preferred region until it has failed two keepalives.

Relatedly apply avoid and no measure no home to ICMP and HTTP checks as
intended.

Updates tailscale/corp#12894
Updates tailscale/corp#29491

Signed-off-by: James Tucker <james@tailscale.com>
2025-06-13 11:05:20 -07:00
Jordan Whited
3ed76ceed3
feature/relayserver,net/{netcheck,udprelay}: implement addr discovery (#16253)
The relay server now fetches IPs from local interfaces and external
perspective IP:port's via netcheck (STUN).

Updates tailscale/corp#27502

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-06-12 09:57:45 -07:00
Brad Fitzpatrick
3b5ce9d1bc tsweb/varz: add binary name to version metric
Fixes tailscale/corp#29530

Change-Id: Iae04456d7ac5527897f060370e90c9517c00a818
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-06-12 08:46:27 -07:00
Irbe Krumina
3219de4cb8
cmd/k8s-operator: ensure status update errors are displayed to users (#16251)
Updates#cleanup

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2025-06-12 13:47:34 +01:00
dependabot[bot]
7c05811af0
.github: Bump actions/setup-go from 5.4.0 to 5.5.0 (#15947)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.4.0 to 5.5.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](0aaccfd150...d35c59abb0)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 5.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-11 23:18:58 -06:00
dependabot[bot]
75a42977c7
.github: Bump slackapi/slack-github-action from 2.0.0 to 2.1.0 (#15948)
Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/slackapi/slack-github-action/releases)
- [Commits](485a9d42d3...b0fa283ad8)

---
updated-dependencies:
- dependency-name: slackapi/slack-github-action
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-11 23:18:14 -06:00
dependabot[bot]
8baa016a23
.github: Bump github/codeql-action from 3.28.15 to 3.28.19 (#16227)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.15 to 3.28.19.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](45775bd823...fca7ace96b)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.19
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-11 23:17:14 -06:00
Claus Lensbøl
6010812f0c
ipn/localapi,client/local: add debug watcher for bus events (#16239)
Updates: #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-06-11 14:22:30 -04:00
Fran Bull
3b25e94352 cmd/natc: allow specifying the tsnet state dir
Which can make operating the service more convenient.
It makes sense to put the cluster state with this if specified, so
rearrange the logic to handle that.

Updates #14667

Signed-off-by: Fran Bull <fran@tailscale.com>
2025-06-11 10:05:18 -07:00
Jordan Whited
6a93b17c8c
types/netmap,wgengine/magicsock: propagate CapVer to magicsock.endpoint (#16244)
This enables us to mark nodes as relay capable or not. We don't actually
do that yet, as we haven't established a relay CapVer.

Updates tailscale/corp#27502

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-06-10 17:31:14 -07:00
Patrick O'Doherty
8114260019
go.toolchain.rev: bump to go 1.24.4 (#16230)
Updates #cleanup

Signed-off-by: Patrick O'Doherty <patrick@tailscale.com>
2025-06-10 14:39:27 -07:00
Mike O'Driscoll
e72c528a5f
cmd/{derp,derpprobe},prober,derp: add mesh support to derpprobe (#15414)
Add mesh key support to derpprobe for
probing derpers with verify set to true.

Move MeshKey checking to central point for code reuse.

Fix a bad error fmt msg.

Fixes tailscale/corp#27294
Fixes tailscale/corp#25756

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
2025-06-10 15:29:42 -04:00
Anton Tolchanov
db34cdcfe7 cmd/tailscale/cli: add a risk message about rp_filter
We already present a health warning about this, but it is easy to miss
on a server when blackholing traffic makes it unreachable.

In addition to a health warning, present a risk message when exit node
is enabled.

Example:

```
$ tailscale up --exit-node=lizard
The following issues on your machine will likely make usage of exit nodes impossible:
- interface "ens4" has strict reverse-path filtering enabled
- interface "tailscale0" has strict reverse-path filtering enabled
Please set rp_filter=2 instead of rp_filter=1; see https://github.com/tailscale/tailscale/issues/3310
To skip this warning, use --accept-risk=linux-strict-rp-filter
$
```

Updates #3310

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2025-06-10 07:38:06 +01:00
Jordan Whited
cc8dc9e4dc
types/netmap: fix NodeMutationEndpoints docs typo (#16234)
Updates #cleanup

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-06-09 16:12:12 -07:00
Jordan Whited
9501f66985
wgengine/magicsock: don't cancel in-progress relayManager work (#16233)
It might complete, interrupting it reduces the chances of establishing a
relay path.

Updates tailscale/corp#27502

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-06-09 15:37:58 -07:00
Jordan Whited
c343bffa72
wgengine/relaymanager: don't start runLoop() on init() (#16231)
This is simply for consistency with relayManagerInputEvent(), which
should be the sole launcher of runLoop().

Updates tailscale/corp#27502

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-06-09 14:49:00 -07:00
Jordan Whited
67b1693c13
wgengine/magicsock: enable setting relay epAddr's as bestAddr (#16229)
relayManager can now hand endpoint a relay epAddr for it to consider
as bestAddr.

endpoint and Conn disco ping/pong handling are now VNI-aware.

Updates tailscale/corp#27502
Updates tailscale/corp#29422

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-06-09 13:17:14 -07:00
Tom Meadows
4456f77af7
cmd/k8s-operator: explicitly set tcp on VIPService port configuration for Ingress with ProxyGroup (#16199)
Updates tailscale/corp#24795

Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>
2025-06-09 11:13:03 +01:00
James Sanderson
5716d0977d health: prefix Warnables received from the control plane
Updates tailscale/corp#27759

Signed-off-by: James Sanderson <jsanderson@tailscale.com>
2025-06-09 10:35:22 +01:00
KevinLiang10
7b06532ea1
ipn/ipnlocal: Update hostinfo to control on service config change (#16146)
This commit fixes the bug that c2n requests are skiped when updating vipServices in serveConfig. This then resulted
netmap update being skipped which caused inaccuracy of Capmap info on client side. After this fix, client always
inform control about it's vipServices config changes.

Fixes tailscale/corp#29219

Signed-off-by: KevinLiang10 <37811973+KevinLiang10@users.noreply.github.com>
2025-06-06 15:20:23 -04:00
Jordan Whited
66ae8737f4
wgengine/magicsock: make endpoint.bestAddr Geneve-aware (#16195)
This commit adds a new type to magicsock, epAddr, which largely ends up
replacing netip.AddrPort in packet I/O paths throughout, enabling
Geneve encapsulation over UDP awareness.

The conn.ReceiveFunc for UDP has been revamped to fix and more clearly
distinguish the different classes of packets we expect to receive: naked
STUN binding messages, naked disco, naked WireGuard, Geneve-encapsulated
disco, and Geneve-encapsulated WireGuard.

Prior to this commit, STUN matching logic in the RX path could swallow
a naked WireGuard packet if the keypair index, which is randomly
generated, happened to overlap with a subset of the STUN magic cookie.

Updates tailscale/corp#27502
Updates tailscale/corp#29326

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-06-06 09:46:29 -07:00
Claus Lensbøl
3f7a9f82e3
wgengine/magicsock: fix bpf fragmentation jump offsets (#16204)
Fragmented datagrams would be processed instead of being dumped right
away. In reality, thse datagrams would be dropped anyway later so there
should functionally not be any change. Additionally, the feature is off
by default.

Closes #16203

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
2025-06-06 11:42:33 -04:00
Fran Bull
3e08eab21e cmd/natc: use new on disk state store for consensus
Fixes #16027

Signed-off-by: Fran Bull <fran@tailscale.com>
2025-06-05 13:37:48 -07:00
Jordan Whited
75a7d28b07
net/packet: fix Parsed docs (#16200)
Updates #cleanup

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-06-05 10:33:16 -07:00