When control deletes a node and the machine re-registers with its
persisted node key, the next netmap has the key on a new nodeID and the
old nodeID absent. magicsock upserted the new peer before removing the
old peer's endpoint, saw a conflict and called devPanicf, crashing
unstable builds (corp services) and leaving the new peer without an
endpoint on stable builds. Remove stale endpoints before upserting, and
treat UpsertPeer of a moved key as an implicit removal of the old
nodeID. Two live peers with one key is a control bug, so controlclient
now drops all but the highest nodeID and logs loudly, and magicsock only
logs if some other caller passes duplicates.
Updates tailscale/corp#52092
Updates tailscale/corp#38410
Updates tailscale/corp#27300
Change-Id: Iedfd312aacd0fb8dcc4dcd459ba26f735269147f
Signed-off-by: Brad Fitzpatrick <[email protected]>
Route SIGINT and SIGTERM through systray.Quit so the native tray loop
returns and invokes the exit callback. Stop signal delivery when Run returns.
Treat watcher cancellation as normal shutdown rather than terminating the
process with log.Fatal, and interrupt the reconnect delay when canceled.
Serialize exit cleanup with menu rebuilds.
Add subprocess tests for SIGINT, SIGTERM and the Quit menu action using a
private session bus and a fake LocalAPI.
Fixes#22582
Change-Id: I2360e203d4cc9bf3f0245133e9535d353b780e2c
Signed-off-by: fQwQf <[email protected]>
TestWriterFloodDoesNotStarveControlFrames checked that a pong queued
during a packet flood went out within a queue's depth of packets by
requiring the highest sequence number written before the pong to be at
most seqAtPong+depth. But the flood keeps the queue full, so enqueue
drops at the head (dropReasonQueueHead), and whenever the writer is
descheduled the flooder can push hundreds of newer packets through the
ring. The next packets the writer dequeues then carry sequence numbers
far past seqAtPong+depth even though it wrote no more than depth
packets before the pong, e.g.:
pong written after packet 4573; want no later than packet 4071 (pong queued at 4039, depth 32)
The server's actual guarantee is in packets written: writePending
sends a pending pong before its queue drain, and each drain pass is
capped at perClientSendQueueDepth packets, so at most depth packets
are written between queuePong and the pong. Measure that directly:
read sclient.packetsSent right after queuePong and have the fake conn
record the packet frame count when the first pong is written. Reading
packetsSent after queuePong means a preemption in the test goroutine
can only loosen the bound, never cause a false failure.
The test still guards the anti-starvation property: with writePending's
per-pass budget removed it fails every run ("pong written after 720
more packets; want at most 32"), and with the budget doubled to
2*depth it fails 11 of 20 runs.
flakestress -p 4 -taskset 0-1:
before: 1401 failures / 24665 runs (5.7%)
after: 0 failures / 45896 runs
Fixes#22347
Change-Id: Ia751bae9789d9eb9f36f978ef14088b955b58785
Signed-off-by: Brad Fitzpatrick <[email protected]>
Remove --unpublished-bootstrap-dns-names and its TXT record rollout
percentages, unused in production since September. Require every
--bootstrap-dns-names entry to be a name that clients' fallback DNS
will ask for, per the shared net/dnsfallback/fallbacknames policy, so
names can be removed but not added. Queries for names outside the
published set now count as counter_bootstrap_dns_unknown_names.
Updates #21028
Change-Id: If9b7c3f6325de63eaaa3ba5bc9143ac5539af2ab
Signed-off-by: Brad Fitzpatrick <[email protected]>
Client logs show that most DERP bootstrap DNS attempts come from clients
with no working network, retrying Tailscale's log and control servers,
and that the rest are mostly for names that DERP servers can't answer.
Skip the fallback when netmon says no interface is up, and don't try it
at all (or log about it) for names that aren't Tailscale's, returning
the original DNS error instead via a new dnscache.ErrNoFallback. The
name policy lives in a new leaf package, net/dnsfallback/fallbacknames,
so cmd/derper can share it.
Updates #21028
Change-Id: I25a0e4cc21866837416a24090a986e1b2dd1e78a
Signed-off-by: Brad Fitzpatrick <[email protected]>
The golangci-lint job's setup-go cache key collided with the CodeQL
workflow's, so PRs restored CodeQL's main-branch build cache, which
lacks the test packages and export data golangci-lint loads. Package
loading thus ran nearly cold every time (~9 of ~10 minutes), and jobs
now regularly hit the 10m timeout. Use a dedicated cache key, and run
on pushes to main so there's a cache for PRs to restore.
Updates #18366
Updates tailscale/corp#28679
Change-Id: I7a23a66dc7198c030d6a378aa2733d558c8c37d9
Signed-off-by: Brad Fitzpatrick <[email protected]>
Add TS_DEBUG_DISABLE_SRC_VALID_MARK to allow disabling
of net.ipv4.conf.all.src_valid_mark being set.
Updates #3310
Updates #19796
Signed-off-by: Mike O'Driscoll <[email protected]>
TestPingPeerLearnedViaDelta failed on Linux and Windows with
Ping(disco): error Post ".../localapi/v0/ping?ip=100.64.0.2&size=0&type=disco": context deadline exceeded
and the same for type=TSMP. The disco variant can't be the wireguard-go
duplicate handshake race fixed by #22537, and it still failed on main
with that fix.
The test puts s1 in manual MapResponse mode, starts s2, then copies
control.Node(s2Key) into a PeersChanged delta for s1. startServer only
waits for s2's local home DERP connection, not for s2's lite map update
carrying its HomeDERP and endpoints to reach control. If the snapshot
was taken first, s1 learned an s2 with no DERP home and no endpoints,
and because s1's automatic map responses are suppressed it never got
the later update, so neither disco nor TSMP pings could reach s2.
TestPingSubnetRouteOfDeltaPeer had the same pattern.
Add controlNodeReachable, which polls control until the node has a
HomeDERP and endpoints, and use it for both snapshots.
Injecting a random 0-300ms sleep before controlclient's SendUpdate
makes the original test fail nearly every run with the exact CI
errors (8/8 subtests); with this change 0 failures in 6 runs each of both
tests under the same injection.
flakestress -p 4 -taskset 0-1 -duration 8m, no injection:
before: 2 failures in 1128 runs (both Ping(disco) deadline)
after: 0 failures in 1148 runs
Fixes#22562
Change-Id: Ic5f0e1498d566a89102d92c216ae892a293d5472
Signed-off-by: Brad Fitzpatrick <[email protected]>
TestClientSideJailing waited only for each node's netmap to show the
peer with the expected IsJailed bit, then made a single 1s DialTCP for
each direction. But a peer's endpoints, DERP home, and disco key reach
the other node via separate map updates that can land after the peer
first appears in the netmap. If the first dial's WireGuard handshake
initiation is sent before then, magicsock drops it ("Failed to send
handshake initiation: no UDP or DERP addr") and wireguard-go does not
retry for 5s, so every "should succeed" dial in that window fails.
That matches the CI failures on the race-root-integration job: both
dials in not_jailed, and sometimes the uni_jailed n2-to-n1 dial too,
failed with exactly 1s/2s subtest durations.
This is a test bug, not a jail propagation bug: the jailed state and
the data plane peer routes and jailed filter are installed under the
same LocalBackend lock as the netmap the test polls.
Retry the dials that should succeed until they connect (up to 20s).
The dials that should fail still get a single attempt, since a late
path can only make them fail more. Also drop the flakytest.Mark.
The flake didn't reproduce unaided locally (0/192 runs; 0/95 with
-race and 2 CPUs). Delaying testcontrol's processing of endpoint
updates by 200ms reproduces it deterministically:
before: 95/95 runs failed (with 200ms injected delay)
after: 0/136 runs failed (with 200ms injected delay)
after: 0/71 runs failed (-race, taskset 0-1, no injection)
Fixes#17419
Change-Id: I779d173d5d6c01fe878848cdfe049e7f29d20775
Signed-off-by: Brad Fitzpatrick <[email protected]>
Covers not-yet-valid, untrusted CA (in date and expired), name mismatch,
cert/key mismatch and bad PEM through the C2N handler and
LocalBackend.CertStatus, and checks that getCertPEM still goes on to
issue a new cert for each unusable cached cert. Also checks that each
certStore returns errCertInvalid for a name mismatch.
Updates #22304
Signed-off-by: chaosinthecrd <[email protected]>
validCertPEM returned a bool and every certStore Read turned any failure
into errCertExpired, so the C2N tls-cert-status response and the
localapi cert-status endpoint reported Expired for an in-date cert that
failed verification for another reason (unknown CA, name mismatch,
cert/key mismatch, bad PEM). This fixes this by returning errCertExpired
only when the leaf is past its NotAfter, and otherwise an error wrapping
a new errCertInvalid that carries the verification error into the status
Error field. A cert that is not yet valid now counts as invalid, not
expired. getCertPEM treats errCertInvalid like errCertExpired, so a
cached cert that fails verification is still reissued.
Fixes#22304
Signed-off-by: chaosinthecrd <[email protected]>
TestTUNDNS failed on Windows CI with:
waitForPeerReachable([uOLy9]): peer [uOLy9]: no endpoints
The peer had a HomeDERP in control but never any endpoints, for 30s.
userspaceEngine.getStatus snapshotted e.endpoints under e.mu, then
walked the wireguard-go peers (which can block on the device mutex),
and only then set AsOf: time.Now(). RequestStatus lets two goroutines
run getStatus concurrently (for example the magicsock endpoints
callback and the TUN "external route: up" event goroutine). If the
goroutine that read the old, empty endpoints finished last, its status
had the newest AsOf, so LocalBackend.setWgengineStatus's AsOf ordering
check accepted it, reset b.endpoints to empty and sent that to
control. magicsock's endpoints hadn't changed, so nothing ever resent
them. On Windows the monotonic clock is coarse, so two statuses can
also get equal AsOf values, which the strict Before check lets through
in either order.
Take AsOf in the same critical section as the endpoints read and make
it strictly increasing, so a status with older endpoints always has an
older AsOf and is discarded.
Reproduced on Linux by injecting a random 0-20ms sleep in getStatus
between the endpoints read and the wgdev peer walk:
before: 9 failures in <=48 runs of TestTUNDNS ("no endpoints")
after: 0 failures in 56 runs
(The natural rate on Linux is too low to measure; the one CI failure
was on Windows.) The other TestTUNDNS failure on the dashboard (Linux,
TSMP ping "context deadline exceeded") was the wireguard-go duplicate
handshake race fixed by the wireguard-go bump in #22537.
Fixes#22563
Change-Id: Id290c7422846dc390d3cd914f7b7cfabe593e739
Signed-off-by: Brad Fitzpatrick <[email protected]>
feature/conn25 installs its tstun.Wrapper hooks from its ipnext
extension's Init, which runs from LocalBackend.Start. By then the
wireguard-go device's RoutineReadFromTUN goroutine is already reading
packets and calling filterPacketOutboundToWireGuard, which read the
plain PreFilterPacketOutboundToWireGuardAppConnectorIntercept field
with no synchronization. A packet from the OS TUN in that window was a
data race; under -race, tailscaled in tstest/integration died with
"WARNING: DATA RACE" (conn25.go installHooks write vs wrap.go:797
read), and the test then failed with "running tailscale status: ...
EOF". All six CI logs examined show this same race.
Make the three hooks conn25 sets after startup
(PreFilterPacketOutboundToWireGuardAppConnectorIntercept,
PostFilterPacketInboundFromWireGuardAppConnector and
OnUnmappedTransitIPMessage) syncs.AtomicValues.
Add TestSetAppConnectorHooksWhileRunning, which installs the hooks
while packets flow in both directions and reproduces the CI race at
the same wrap.go line.
flakestress -race TestSetAppConnectorHooksWhileRunning:
before: 12564/12564 runs failed; after: 0/1176 runs.
The integration flake was too rare to measure locally (a few failures a
week in CI). It was blamed on tstest/integration TestTUNMode,
TestMagicDNS and TestSplitDNS.
Fixes#22557
Change-Id: Iff618c18c11f84dcbae27805024e908403031a08
Signed-off-by: Brad Fitzpatrick <[email protected]>
Enable the existing Android-safe interface fallback in cgo
builds. Keep androidbin out of condregister for Android cgo
applications, which provide their own interface getter; embedded
consumers can opt in by importing androidbin directly.
Updates #17311
Change-Id: Ia26706d9757525c1bc619935574797808b693034
Signed-off-by: Loz Brown <[email protected]>
The ts2021 protocol speaks HTTP/2 inside the Noise stream. With
GODEBUG=http2client=0 (or the nethttpomithttp2 build tag), net/http
can't, and http.DefaultTransport also never gets a TLSClientConfig,
which made controlhttp crash tailscaled with a nil pointer dereference.
Return a clear user-visible error from ts2021.NewClient instead, and
make netutil.NewDefaultTransport always return a non-nil
TLSClientConfig.
Fixes#22578
Change-Id: I119c6ebbd6f1bbb5c693fb44a577862b98e688f3
Signed-off-by: Brad Fitzpatrick <[email protected]>
Building cigocacher took most of the ~15-27s "Set up cigocacher" step
on every Windows job. Cache the binary in actions/cache, keyed on
cmd/cigocacher, go.mod, and go.sum, and add a test that cigocacher has
no other tailscale.com dependencies so that key stays complete.
Updates tailscale/corp#34812
Updates tailscale/corp#28679
Change-Id: I2def6f28a045249b2e87331a1f42c621e161031f
Signed-off-by: Brad Fitzpatrick <[email protected]>
The static fallback DERP map embedded in net/dnsfallback still lists
node 6a at 68.183.90.120 (an old Bangalore DigitalOcean IP). That IP
is no longer a Tailscale DERP server: it now belongs to an unrelated
nginx host that either times out or answers /generate_204 with "404
Not Found". Captive portal detection treats any 404 as a captive
portal.
This is a production bug, not just a test bug: a client without a
DERP map yet (fresh start, no on-disk cache) falls back to this static
map, so a detection that picks 6a wrongly warns the user about a
captive portal. It also made TestDetectCaptivePortalReturnsFalse,
which probed five random nodes from that map, flaky whenever 6a was
picked and nginx happened to answer.
Region 6's only node, 6a, is dead, so remove region 6 entirely. The
DERP server at that IP was retired when region 6 moved from
DigitalOcean Bangalore to Linode Mumbai (tailscale/corp#50435,
tailscale/corp#51314). Region 6 still exists in the control-sent DERP
map, but its new nodes are deliberately not added here: the list is
not regenerated or grown, as we're moving away from DERP servers
acting as bootstrap DNS servers (#21028). If a cached DERP map from
control has a region 6, GetDERPMap still merges it in whole, as it
does for any region missing from the static map.
Also make the test hermetic. It now runs Detect against five local
derpserver.ServeNoContent servers on 127.0.0.1. Five is enough that
the controlplane/login.tailscale.com endpoints sorted after them are
never tried. The servers listen on tcp4 explicitly, because when
httptest falls back to [::1] the challenge "ts_[::1]:port" is
rejected by isChallengeChar. Add TestDetectCaptivePortalReturnsTrue,
where one server answers 404 like the stale node did. Both tests skip
if no local server got a request (no usable non-loopback interface).
TestEndpointsAreUpAndReturnExpectedResponse still covers the real
endpoints.
Failures were seen on Linux and Windows, on main and many branches
(37 on the flakes dashboard since 2026-11-13):
http://flakes/flake?name=tailscale.com%2Fnet%2Fcaptivedetection.TestDetectCaptivePortalReturnsFalse
flakestress -p 4, before: 48/418 runs failed (11.5%), all with
"want=204, got=404". After: 0/4250 runs of TestDetectCaptivePortal*
(throttled to 2 workers with 100ms pauses; unthrottled stress of a
10ms test uses up local ephemeral ports in TIME_WAIT and fails in
bind instead).
Fixes#22550
Updates #21028
Change-Id: I2a45e7fb3e21b887bfd0952a846c98d68b03f89c
Signed-off-by: Brad Fitzpatrick <[email protected]>
On Windows, winMon.Close unregisters the route/address/interface change
callbacks and waits for in-flight ones to return. Those callbacks call
Monitor.isActive, which takes m.mu. Monitor.Close held m.mu across
om.Close, so a change notification arriving during Close deadlocked
with it, and the test binary hung until the timeout.
Release m.mu before calling om.Close. m.closed is already set under the
lock, so late callbacks see the monitor as inactive and return.
This is also the root cause of the Windows "ipnlocal: watchdog timeout"
panics that kill the ipn/ipnlocal and wgengine/netstack test binaries.
Add TestMonitorCloseWaitsForOSCallback, which uses a fake osMon whose
Close, like winipcfg's Unregister, waits for a callback that needs
m.mu. That reproduces the deadlock on any OS.
flakestress TestMonitorCloseWaitsForOSCallback, -p 4, linux:
before: 16/16 runs deadlocked
after: 0/135569 runs
Fixes#22228Fixes#22548
Change-Id: Ibe7740ca23a1ab375d37c280838942f49b4a6a8f
Signed-off-by: Nick Khyl <[email protected]>
Signed-off-by: Brad Fitzpatrick <[email protected]>
Instead of restoring the module cache from actions/cache, the Windows
jobs now install WinFsp and mount a gomodfs remote store (on the Azure
VNet, at vars.GOMODFS_AZURE_URL, defaulting to ci-gocached-azure-1:8090)
on M:, which also provides the tsgo toolchain via ~/.cache/tsgo. gomodfs
is started via ShellExecute so it doesn't inherit the step's pipes,
which would make the runner kill it at the end of the step, and a
separate step checks that it survived before pointing GOMODCACHE at it.
If anything fails, the jobs warn and fall back to downloading modules
and the toolchain directly.
Updates tailscale/corp#34812
Change-Id: I26cea9cfa483d5fb3fd51b1d0f87a9204f792690
Signed-off-by: Brad Fitzpatrick <[email protected]>
The test started 400 requests at once, each proxied over a fresh
loopback connection to one httptest server. On Windows, the dials that
overflow the listen backlog are refused, the proxy returns an empty 502,
and the test reported that as "/ops: capabilities header missing". Cap
the requests in flight at 8 and report non-200 responses as such.
Reproduced on Linux in a network namespace with net.core.somaxconn=128
and tcp_abort_on_overflow=1 (12 of 200 runs failed). With the fix, 0 of
5000 failed there, and 0 of 2000 with somaxconn=8. With the original
bug fix from 566f89e0f reverted, the test still fails 50 of 50 runs.
Flakes analysis: http://flakes/analyze-test?name=tailscale.com%2Fipn%2Fipnlocal.TestServeAppCapsConcurrentStreamsFixestailscale/tailscale#22543
Change-Id: Ia3f74832d958744442b837d928a21aafa0445772
Signed-off-by: Brad Fitzpatrick <[email protected]>
packetFilterAllow holds c.mu while touching nothing it protects.
It only calls getIPSets, a func field assigned once in newConn25
that reads the config out of an atomic pointer.
Its siblings transitIPInPool and destinationInPools already call
it unlocked. Drop the acquisition, which besides being dead
was a lock-ordering hazard if getIPSets ever grows a lock of its own.
Updates https://github.com/tailscale/corp/issues/38924
Change-Id: I2942a9b0a6a57378473393c62611c557f07e71b3
Signed-off-by: Mazdak Nasab <[email protected]>
Two methods read or write state guarded by their receiver's mutex without
taking it, relying on every caller to hold it, but were not named to say
so. enqueueAddressAssignment documented the requirement in prose only;
lookupAddrBySrcIPAndTransitIP had no doc comment at all. Rename both with
the Locked suffix the package already uses for drainAddrsLocked,
transitIPRoutableLocked and removeFlowLocked, and give the connector
lookup a doc comment stating the requirement.
Fixes https://github.com/tailscale/corp/issues/38924
Change-Id: Ib8bcaf5809ae6f982a504ae554ad1304dbb53018
Signed-off-by: Mazdak Nasab <[email protected]>
Add Docker integration tests for TCP and Unix forwarding, pty size,
resize and modes, session env, envknobs, x11 rejection, session
teardown, SessionDuration, policy changes and RuleExpires on active
sessions, Shutdown, host keys and utmp, and run every integrationtest
test in the Dockerfile. Extend the vmtest SSH tests to use real
OpenSSH clients across the tailnet for pty, sftp/scp, agent and port
forwarding, AcceptEnv, ControlMaster, large transfers, banners, user
mapping, revocation, check mode (via a new testcontrol handler),
recording, and the tailscale ssh CLI. Fix make sshintegrationtest,
which only ever tested one image and always exited 0, and trigger the
workflow on go.mod changes and a schedule.
Updates #13038
Updates tailscale/corp#50380
Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: Ie4fffad7e9298b6b77c3ec3a6ae81fd784d182ce
A Reader is shared by all effective policies that include its source.
A forced read through one of them updated the Reader's cached snapshot
and marked it up to date, but didn't notify the other sessions, so
their policies kept the old settings.
Since a89b32904, "tailscale syspolicy reload" reloads the caller's user
policy rather than the device policy used by LocalBackend. On Windows,
a registry change made without a Group Policy refresh was therefore
reported as configured by the CLI but never applied by the backend.
Updates tailscale/corp#51820
Signed-off-by: Nick Khyl <[email protected]>
When an update is requested via LocalAPI, updateWindows runs inside
tailscaled, and its os.Exit(0) after launching the tailscale.exe copy
made the service restart the tailscaled child process immediately.
Exit only when running as tailscale.exe. In tailscaled.exe,
wait for the installer instead, which stops the service as part
of the upgrade. As a side effect, an install that fails before
stopping the service is now reported as a failed update.
Updates tailscale/corp#40430
Change-Id: I8af60fa12740dafceb7c9ea4f50d87c1cad27fa4
Signed-off-by: Nick Khyl <[email protected]>
Implement the new peerapi hook and add the tokens authenticating that
the destination IP addresses were seen by this connector when forwarding
a DNS query for the given app.
Updates tailscale/corp#46169
Signed-off-by: Fran Bull <[email protected]>
To allow logic to be shared between client and connector, to allow the
connector to parse a DNS response to add its tokens that authenticate it
returned a given address for a given app.
Updates tailscale/corp#46169
Signed-off-by: Fran Bull <[email protected]>
Setting a deadline on a Pipe starts a goroutine that wakes blocked
readers or writers when it passes, and only a later SetDeadline or Close
cancels it. But Close only cancels the timers it finds, so setting a
deadline after Close started a goroutine nothing would ever cancel,
which lived until the deadline passed.
An http.Server does exactly that if it's closed between accepting a
conn and serving it: conn.serve sets the TLS handshake deadlines on the
already-closed conn, then fails the handshake. Under synctest, the
leftover goroutines make the test fail with "main bubble goroutine has
exited but blocked goroutines remain", as seen in a lansport test in
tailscale/tb on Windows CI.
A closed Pipe has no blocked readers or writers left to wake, so don't
arm a timer for it. The deadline itself is still recorded.
Updates tailscale/corp#51705
Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: I772ca698fc81f7389542e87d108eec0c04b98df1
The write replica of an HA ProxyGroup (cert share "rw") doesn't keep TLS
certs in memory, so that it notices a recreated, empty cert Secret and
issues a new cert. As a result, it read the cert Secret from the API
server on every TLS handshake, with a 30s timeout. When the API server
was slow or unavailable, handshakes on that replica waited for the read,
and feature/acme repeated the read under the per-domain lock. Clients
with a 10s handshake timeout, such as kubectl, failed.
This commit adds a small per-domain cache of the last-known-good cert
and key for write replicas. The replica serves a cached cert for 30s
before it reads the Secret again. When it has a cached cert, the read
uses a 3s timeout, and on an error other than not found or forbidden
the replica serves the cached cert and waits another 30s before the
next read. A read that finds the Secret missing, forbidden or empty
removes the cached cert and returns ipn.ErrStateNotExist as before, so
a recreated Ingress still gets a new cert, at most 30s later.
Concurrent reads of the same Secret share one GET, and a read that is
in flight when a cert is written does not replace the written cert.
A Secret watch remains the long-term fix.
Fixes#22009
Change-Id: Id107bf0a7628a1a026f94e621173d7c5d02fb451
Signed-off-by: David Bond <[email protected]>
* k8s-operator: stop PortRanges.All() at the last port in the range
PortRanges.All() walks a range with a uint16 counter and a port <= end
condition. When end is 65535 the increment wraps back to zero instead
of ending the loop, so the iterator restarts at 0 and yields the whole
port space again, and again.
ClashesWith is the caller that drains All(), so it is where this
shows. With one ProxyClass holding 40000-65535, validating a second
one holding 30000-30100 walks up to 65535, wraps, and reaches 30000 on
the next pass, where Contains returns true. The two ranges are
disjoint, but the second ProxyClass is rejected as clashing and never
goes valid. allocatePorts stops at the first free port so it returns,
but once past 65535 the port it picks is outside the range that was
configured.
endPort is only bounded by the cluster's --service-node-port-range, so
65535 is reachable on a cluster configured up to it.
Yield end and then stop. Also skip a range whose Port is above its
EndPort, which the old condition did for free and the new one would
not.
Fixes#21304
Change-Id: I7d60b133a4a83678bc6aba76c5f9b6b6e9e4e984
Signed-off-by: leoca <[email protected]>
* k8s-operator: fix copyright header on types_proxyclass_test.go
TestLicenseHeaders wants "Tailscale Inc & contributors"; the new test
file had the older "Tailscale Inc & AUTHORS" wording and failed the
licenses check.
Change-Id: I3217a0795d1c23aba5eb01b3b62ee825efa0f137
Signed-off-by: leoca <[email protected]>
* k8s-operator: count PortRanges.All() with an int
An int counter cannot wrap at 65535 and an inverted range still
yields nothing, so the explicit guard and the break on end are not
needed.
Change-Id: Ia3de3c0e1336f821a6c99af4e23f221024582e53
Signed-off-by: leoca <[email protected]>
---------
Signed-off-by: leoca <[email protected]>
ClientPrepareNewFlowForMagicIP folded resolving a Magic IP and counting the
flow into one call, and the datapath dropped its own IsValid check on the
resolved Transit IP in favor of trusting the new ok return. That left the
validity requirement stated only in the Conn25Datapath doc comment, and an
implementation that violates it panics the packet path two different ways.
A zero Transit IP is neither Is4 nor Is6, so it slips past both of
checksum.UpdateDstAddr's family-mismatch panics and reaches As4, which
panics in turn; a valid Transit IP in the other family hits one of those
family-mismatch panics outright. Check for both, releasing the counted
reference since no flow is installed, so the packet passes through
unmodified as before.
Updates https://github.com/tailscale/corp/issues/44273
Change-Id: Ib0c0eaa92bc4f0470299da08d48c865e1d101849
Signed-off-by: Mazdak Nasab <[email protected]>
newIPTablesRunner returned the error from the IPv6 go-iptables constructor,
which made tailscaled exit at startup. The nft flavor of ip6tables exits 1
from "--version" on kernels without nf_tables even though the binary is
present. Treat that like a missing ip6tables and disable tunneled IPv6.
Fixes#20348
Signed-off-by: Brendan Creane <[email protected]>
And associated tests to cover WireGuard handshake messages with the
retry bit set.
Updates tailscale/corp#50068
Signed-off-by: Jordan Whited <[email protected]>
In controlknobs.Knobs, each atomic field represents a knob controlled
by the existence of a capability in the node’s CapMap. This patch adds
a doc comment for each field referencing which nodecap.Cap sets it.
This patch also cleans up UpdateFromNodeAttributes to unify the
CapMap lookup with the setting of the appropriate Knobs field.
Previously, it was easier to accidentally mismatch them because they
were split in two places.
Updates #cleanup
Change-Id: I329b0c5732f1c13f2e0d8609c35f42ad645b6bd7
Signed-off-by: Simon Law <[email protected]>
Covers a new ProxyGroup getting a Parallel StatefulSet, and an existing
OrderedReady one being deleted and then recreated as Parallel.
Updates tailscale/corp#38175
Signed-off-by: chaosinthecrd <[email protected]>
With a readiness probe and the default OrderedReady policy, one unready
ProxyGroup Pod stops the rest from starting, so ProxyGroup StatefulSets now
use Parallel. The policy can't change in place, so an existing StatefulSet is
deleted with its Pods orphaned and recreated, adopting them.
Updates tailscale/corp#38175
Signed-off-by: chaosinthecrd <[email protected]>
Covers the ProxyClass probe defaults and overrides, the env cases that skip or
move the probes, probes on ProxyGroup proxies, and rejecting probes on the
init container or with an env that leaves the endpoints unreachable.
Updates tailscale/corp#38175
Signed-off-by: chaosinthecrd <[email protected]>
Proxies now serve /livez and /readyz, but nothing points Kubernetes probes at
them. This adds livenessProbe and readinessProbe fields to the ProxyClass
Tailscale container, each off unless set, with tunable timing (older proxy
images don't serve the endpoints, so a probe would fail against them), and
wires them into ProxyGroup proxies. A ProxyGroup is rejected if its ProxyClass
sets probes but its env would leave the endpoints unreachable, such as
TS_ENABLE_HEALTH_CHECK=false, TS_LOCAL_ADDR_PORT on loopback, or the
deprecated TS_HEALTHCHECK_ADDR_PORT. Probes follow a custom TS_LOCAL_ADDR_PORT
port, and liveness gets a 5s timeout by default, as a restart drops traffic
that a slow tailscaled still carries.
Updates tailscale/corp#38175
Signed-off-by: chaosinthecrd <[email protected]>
Covers the Probe handlers and conditions, AllCertsPresent with present,
missing, expired and unreadable certs, and the containerboot checks for
tailscaled failing or timing out, certs for advertised HTTPS-only Services and
a serve config file that doesn't exist.
Updates tailscale/corp#38175
Signed-off-by: chaosinthecrd <[email protected]>
Proxies only serve /healthz, which reports whether the node has a tailnet IP,
so it can't back a liveness or readiness probe. When TS_ENABLE_HEALTH_CHECK is
set, containerboot now also serves /livez, which fails only when tailscaled
stops answering LocalAPI, and /readyz, which passes once the node has tailnet
IPs and, with TS_SERVE_CONFIG set, has applied the serve config and has a cert
for each HTTPS-only Tailscale Service it advertises. Certs are checked through
the read-only cert-status endpoint so the probe never triggers issuance. An
expired or unreadable cert counts as present, as failing readiness on it would
stop a StatefulSet rollout before it reaches the replica that renews certs.
Updates tailscale/corp#38175
Signed-off-by: chaosinthecrd <[email protected]>
This device policy hides entry points to the new windowed UI and uses the legacy tray based menu instead
Updates tailscale/corp#50029
Signed-off-by: kari-ts <[email protected]>
Add an optional auth-exchange-attempts flag to up that allows for
controlling the number of attempts made on transient errors (e.g, 5XX or
client-side deadline exceeded errors) during OAuth or workload identity
federation auth exchange operations.
This defaults to 1 (e.g., no retries). Specifying a larger number of
attempts enables retrying the auth exchange with exponential backoff
instead of the default of failing after a single try.
Updates https://github.com/tailscale/tailscale/issues/20339
Signed-off-by: Mario Minardi <[email protected]>
The current command fails with:
invalid value "15" for flag -timeout: parse error
because the timeout flag wants a time.Duration value.
Updates #cleanup
Change-Id: I645974078ce60c42b9d5d7bd227226de5fff26ad
Signed-off-by: Francois Marier <[email protected]>
In 2c7aeadb1d we cleaned up some extra
logs but did not remove all logs of disco keys moving from zero to non
zero keys. Remove more log lines that we do not need to see.
Updates #cleanup
Signed-off-by: Claus Lensbøl <[email protected]>