9061 Commits

Author SHA1 Message Date
Anton Tolchanov
008a35c677 cmd/lopower: expose metrics and tsnet logs 2025-05-08 07:44:10 +01:00
Anton Tolchanov
e83fe9a762 cmd/lopower: add verbose-dns 2025-05-08 07:44:10 +01:00
Anton Tolchanov
c8deed69ae net/dns: use fallback resolvers as default if they are absent
Otherwise we reset DNS configuration to empty after failing to collect
base OS configuration from dns.noopManager, e.g.

```
2025/05/08 05:48:08 wgengine: Reconfig: configuring DNS
2025/05/08 05:48:08 dns: Set: {DefaultResolvers:[] Routes:{cat-ray.ts.net.:[] ts.net.:[199.247.155.53 2620:111:8007::53]}+65arpa SearchDomains:[cat-ray.ts.net.] Hosts:50}
2025/05/08 05:48:08 health(warnable=dns-read-os-config-failed): error: Tailscale failed to fetch the DNS configuration of your device: getting OS base config is not supported
2025/05/08 05:48:08 health(warnable=dns): error: getting OS base config is not supported
2025/05/08 05:48:08 [v1] authReconfig: ra=false dns=true 0x00: getting OS base config is not supported
2025/05/08 05:48:08 [v1] authReconfig: ra=false dns=true 0x00: <nil>
```
2025-05-08 07:44:10 +01:00
Brad Fitzpatrick
16e1249eb7 cmd/lopower: fix typo
Change-Id: Ifebcd361d80f093e93be4646badaebd856316018
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
404dd02624 cmd/lopower: flesh out README
Change-Id: Iece542369f4124a3e7e46653211b081bce601a29
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Maisem Ali
c142623d69 Update README.md 2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
2f570366ac cmd/lopower: flesh out Limitations
Change-Id: Ifef0f10e8a516caa5ba63c37605f3af4f183c1e0
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
6240c78684 cmd/lopower: add Limitations to README
Change-Id: I6baaa7fa45eaa0c90482123acc51d0f402205e96
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
7fdeedcda3 cmd/lopower: add start of a README
Change-Id: Ie4d5a8e0a53dafdf3b479457b309ac963b78f9bc
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
455e926d09 cmd/lopower: add TCP DNS support
Change-Id: I3288bfd538e2662d644c75e62e6c5cdb24464386
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
b8d9c3bc88 cmd/lopower: set ultimate fallback DNS servers
Change-Id: I044d6c7b9dc4b874f3c60d2c6ce2105bafc00639
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
f39f8ab4d7 cmd/lopower: filter MagicDNS A records when IPv4 disabled
Change-Id: I5c34707e9918b1fc5401075dd6b69fc582de77d9
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
227167656e cmd/lopower: add TODO for TCP DNS
Change-Id: I6027c41cbec2b4b146b8b96ad9c6b60f2ef2c520
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
4c516c2249 cmd/lopower: refactor in prep for DNS filtering
Change-Id: I4a4c2d8331fbc2a7aaab4e75c27b29afaaeb0300
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
ddc5d14d09 cmd/lopower: force AAAA records in DNS server
Change-Id: I79582e4ffd468c217df3e8c02bbf65d911a4f0fe
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
89d042d6e5 cmd/lopower: add start of DNS server
Change-Id: Ibc9b1ee914a649a4f032062c23d700cfbef84312
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Brad Fitzpatrick
8dbbd01bb4 cmd/lopower: add verbose-packets and include-v4 flags
Change-Id: I523feb2a1d4b409689f6011ae03cbc336c695ecf
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:50:11 +01:00
Maisem Ali
f7b6ff52b1 cmd/lopower: add interface addresses to netstack
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2025-05-05 09:50:11 +01:00
Maisem Ali
5865d33b41 cmd/lopower: add udp forwarding
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2025-05-05 09:50:11 +01:00
Maisem Ali
44795dea4b cmd/lopower: get e2e packets working
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2025-05-05 09:34:36 +01:00
Brad Fitzpatrick
922d65ed11 cmd/lopower: add QR code handler
Change-Id: I0c379cfeff9855b745ba705beb574dab6d26b305
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:34:36 +01:00
Maisem Ali
5ee9896a09 cmd/lopower: add tcp forwarding/stitching
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2025-05-05 09:34:36 +01:00
Maisem Ali
e3ee9c4980 cmd/lopower: move lp init to newLP
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2025-05-05 09:34:36 +01:00
Brad Fitzpatrick
0f881a9d09 cmd/lopower: wire up --wg-port flag
Change-Id: I406cf97c4af27c2ac4b4fe28eb8a3b30fac37e5b
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:34:36 +01:00
Brad Fitzpatrick
507c359a44 wgengine/wgcfg: restore Config.ListenPort for cmd/lopower
It was removed for being unnecessary in 69cdc30c6d41aab2 in 2021
but now we need it for lopower.

Change-Id: I62aca850ad820a83475c8ef7655a08981f23a27f
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:34:36 +01:00
Maisem Ali
6b69efe91a cmd/lopower: hook up read/write
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2025-05-05 09:34:36 +01:00
Brad Fitzpatrick
98907c4cd5 cmd/lopower: add start of some flags
Change-Id: Ic633e0d158e689b4108fecf0fc353d37fb22f375
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:34:36 +01:00
Maisem Ali
2371b51b33 cmd/lopower: move reconfig to lpServer
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2025-05-05 09:34:36 +01:00
Maisem Ali
c91f46eeb0 cmd/lopower: add skeleton wg bringup
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2025-05-05 09:34:36 +01:00
Brad Fitzpatrick
6d2deb3607 cmd/lopower: start of a shell
Change-Id: I07eebc68cb48aa956b9eb8e67b06375df6458a48
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-05 09:34:36 +01:00
Brad Fitzpatrick
b03a2a323b tstest/integration: work around ETXTBSY flake
This is a hack, but should suffice and be fast enough.

I really want to figure out what's keeping that writable fd open.

Fixes #15868

Change-Id: I285d836029355b11b7467841d31432cc5890a67e
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-04 11:00:56 -07:00
Brad Fitzpatrick
32ce1bdb48 ipn/ipnlocal: use "nb" consistently as receiver for nodeBackend
Cleanup after #15866. It was using a mix of "b" and "c" before. But "b"
is ambiguous with LocalBackend's usual "b".

Updates #12614

Change-Id: I8c2e84597555ec3db0d783a00ac1c12549ce6706
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-02 17:44:40 -07:00
Brad Fitzpatrick
653c45585e ipn/ipnlocal: rename localNodeContext to nodeBackend
As just discussed on Slack with @nickkhyl.

Updates #12614

Change-Id: I138dd7eaffb274494297567375d969b4122f3f50
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-02 17:30:46 -07:00
Brad Fitzpatrick
4fa9411e3f logtail: remove unneeded IP redaction code
Updates tailscale/corp#15664

Change-Id: I9523a43860685048548890cf1931ee6cbd60452c
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-02 13:37:27 -07:00
Jordan Whited
fd63123849
wgengine/magicsock: shape relayManager and CallMeMaybeVia handling (#15864)
relayManager will eventually be responsible for handling the allocation
and handshaking of UDP relay server endpoints.

relay servers are endpoint-independent, and Conn must already maintain
handshake state for all endpoints. This justifies a new data structure
to fill these roles.

Updates tailscale/corp#27502

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-05-02 13:08:17 -07:00
Brad Fitzpatrick
761aea3036 tstest/integration: don't require TestMake, stop leaking binaries in /tmp
Previously all tests shared their tailscale+tailscaled binaries in
system /tmp directories, which often leaked, and required TestMain to
clean up (which feature/taildrop didn't use).

This makes it use testing.T.TempDir for the binaries, but still only
builds them once and efficiently as possible depending on the OS
copies them around between each test's temp dir.

Updates #15812

Change-Id: I0e2585613f272c3d798a423b8ad1737f8916f527
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-02 12:22:47 -07:00
Andrew Lytvynov
3105ecd958
hostinfo,tailcfg: report TPM availability on windows/linux (#15831)
Start collecting fleet data on TPM availability via hostinfo.

Updates #15830

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2025-05-02 11:01:13 -07:00
Jordan Whited
f05347a5bf
wgengine/magicsock: implement more relay handshake disco handling (#15856)
Conn.handleDiscoMessage() now makes a distinction between relay
handshake disco messages and peer disco messages.

Updates tailscale/corp#27502

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-05-02 09:04:18 -07:00
Brad Fitzpatrick
383664b2f7 cmd/tsidp: remove backticks in README in shell example
Fixes #15818

Change-Id: I7a6f4c7368fed74b865a63acdea4559c3d0a0d09
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-01 12:18:50 -07:00
Brad Fitzpatrick
e415f51351 feature/taildrop: add integration test
Taildrop has never had an end-to-end test since it was introduced.

This adds a basic one.

It caught two recent refactoring bugs & one from 2022 (0f7da5c7dc0).

This is prep for moving the rest of Taildrop out of LocalBackend, so
we can do more refactorings with some confidence.

Updates #15812

Change-Id: I6182e49c5641238af0bfdd9fea1ef0420c112738
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-01 12:15:40 -07:00
Brad Fitzpatrick
a0d7c81a27 ipn/ipnlocal: fix Taildrop regression from refactoring
This fixes a refactoring bug introduced in 8b72dd7873201

Tests (that failed on this) are coming in a separate change.

Updates #15812

Change-Id: Ibbf461b4eaefe22ad3005fc243d0a918e8af8981
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-01 10:34:10 -07:00
KevinLiang10
e05e620096
util/linuxfw: fix delete snat rule (#15763)
* util/linuxfw: fix delete snat rule

This pr is fixing the bug that in nftables mode setting snat-subnet-routes=false doesn't
delete the masq rule in nat table.

Updates #15661

Signed-off-by: Kevin Liang <kevinliang@tailscale.com>

* change index arithmetic in test to chunk

Signed-off-by: Kevin Liang <kevinliang@tailscale.com>

* reuse rule creation function in rule delete

Signed-off-by: Kevin Liang <kevinliang@tailscale.com>

* add test for deleting the masq rule

Signed-off-by: Kevin Liang <kevinliang@tailscale.com>

---------

Signed-off-by: Kevin Liang <kevinliang@tailscale.com>
2025-05-01 12:12:36 -04:00
Anton Tolchanov
fe0090909b cmd/tailscale/cli: unhide --posture-checking flag to set
Updates #5902

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2025-05-01 10:09:12 +01:00
Brad Fitzpatrick
c09cd34f59 ipn/ipnlocal: fix Taildrop deadlock
This fixes the Taildrop deadlock from 8b72dd787320.

Fixes #15824

Change-Id: I5ca583de20dd0d0b513ce546439dc632408ca1f1
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-04-30 21:21:37 -07:00
Jordan Whited
ac04338a0d
wgengine/magicsock: fix discoInfo leak (#15845)
Conn.sendDiscoMessage() now verifies if the destination disco key is
associated with any known peer(s) in a thread-safe manner.

Updates #15844

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-04-30 19:07:31 -07:00
Jordan Whited
080387558c
wgengine/magicsock: start to make disco reception Geneve aware (#15832)
Updates tailscale/corp#27502

Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-04-30 13:31:35 -07:00
Brad Fitzpatrick
ab2deda4b7 tsnet: add FunnelTLSConfig FunnelOption type
And also validate opts for unknown types, before other side effects.

Fixes #15833

Change-Id: I4cabe16c49c5b7566dcafbec59f2cd1e0c8b4b3c
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-04-30 10:36:35 -07:00
Andrew Lytvynov
a9b3e09a1f
tool/gocross: break circular dependency on tailcfg (#15829)
Instead of using the version package (which depends on
tailcfg.CurrentCapabilityVersion) to get the git commit hash, do it
directly using debug.BuildInfo. This way, when changing struct fields in
tailcfg, we can successfully `go generate` it without compiler errors.

Updates #9634
Updates https://github.com/tailscale/corp/issues/26717

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2025-04-29 17:35:47 -07:00
Brad Fitzpatrick
cc6f367520 tstest/integration: remove vestigial env var set in tests
TS_CONTROL_IS_PLAINTEXT_HTTP no longer does anything as of
8fd471ce5748d2129dba584b4fa14b0d29229299

Updates #13597

Change-Id: I32ae7f8c5f2a2632e80323b1302a36295ee00736
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-04-29 07:34:00 -07:00
James Sanderson
1f1c323eeb control/controlclient,health: add tests for control health tracking
Updates tailscale/corp#27759

Signed-off-by: James Sanderson <jsanderson@tailscale.com>
2025-04-29 12:36:38 +01:00