Skip to content

Release v1.5.10 - #358

Merged
cuonglm merged 14 commits into
v1.0from
release-branch-v1.5.10
Nov 11, 2026
Merged

cuonglm merged 14 commits into
v1.0from
release-branch-v1.5.10

Conversation

@cuonglm

@cuonglm cuonglm commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Minor Release

This contains new diagnostics and bug fixes.

Added

  • Named another product's DNS proxy on macOS. ctrld installs no Network Extension, so an enabled DNS proxy configuration belongs to another product, and macOS hands it ctrld's own lookups too. In intercept mode the start context and every DNS self loop report now carry dns_proxies_enabled with the app and provider bundle IDs, and ctrld logs one warning at intercept start, before any lookup fails. A Cisco Umbrella DNS proxy left enabled after an MDM removal is a known cause

Changed

  • Documented that tooling which writes Group Policy NRPT rules straight into the registry must run its own Group Policy refresh. Windows loads such a rule only during Group Policy processing, and ctrld does not force a full machine policy refresh for a rule it has not verified

Fixed

  • Ended DNS self loops at the first return. When the intercept exemption for ctrld's own traffic does not apply, a query ctrld sends can come back to its own listener and be forwarded again, holding a listener slot at every step until the host's other DNS waits. ctrld now recognizes its own returned query, answers it at once and fails only that exchange. It reports the loop at most once per interval, with the host context that can explain it. Internal Domain failures caused by a loop are logged as self_loop
  • Kept the macOS _ctrld group off GIDs other software needs. Intercept mode took the first free GID from 350, which every Nix installer for macOS needs for its nixbld group. The group now gets a GID in 600–699, and an existing group outside that range, or one sharing its GID with another group (locally or in a bound directory), is moved on start. A shared GID would also exempt the other software's DNS from intercept. Uninstall now removes the group
  • Fixed OS resolver queries to tunnel-only resolvers behind a full-tunnel VPN on macOS. A query bound to the physical address left on the wrong interface and got no reply. ctrld now retries it on the kernel-selected route after a read timeout when that route uses a different source, and keeps using that route for the server until the network changes
  • Kept VPN DNS exemptions through network-change recovery in intercept mode on macOS. Recovery rebuilt the pf anchor from the new network's nameservers alone, so a Tailscale interface lost its passthrough rules until the pf watchdog reloaded the anchor
  • Stopped escalating Windows DNS intercept recovery on a late NRPT probe. A probe that reaches ctrld within 15 seconds of the first probe of a heal cycle now counts as verified, so ctrld no longer refreshes policy, flushes and retries. Each of those retries held the DNS Client for about 7 seconds, stretching the post-boot stall to 1–2.5 minutes. Service startup keeps the 2-second probe
  • Reported provisioning failures to the host app on Android and iOS instead of exiting. ctrld shares the app's process there, so exiting used to kill the app
  • Stopped a CPU core from spinning on Linux when the NDP neighbor subscription ends, for example with ENOBUFS. ctrld now logs why it ended and resubscribes with a backoff from 1 second up to 1 minute, then rescans the neighbor table
  • Resolved NetBIOS-only and mDNS-only LAN names in Windows Intercept mode. Intercept mode stopped Windows from falling back to NetBIOS and mDNS when DNS has no answer, so ctrld now does that fallback itself

cuonglm and others added 11 commits November 5, 2026 14:25
… ends

The netlink library closes the neighbor update channel when the
subscription fails, for example with ENOBUFS. The consumer kept reading
zero-value updates from the closed channel, burning a CPU core until
shutdown without logging anything.

Detect the closure, log why the subscription ended, and resubscribe
with a backoff of 1s doubling up to 1m. A subscription that cannot be
opened is retried the same way, with its own log message. After each
resubscription the NDP table is rescanned to pick up neighbors added
meanwhile; deletions missed in that window are not recovered.
Cancelling now also drains the update channel, so the library's
receive goroutine exits.
TestVPNDNSRefreshKeepsLastTailscaleRoutesAndRetries stubs the retry
delay to 10ms. On the Windows runner the retry can fire before the
test checks the last good routes after the failed read: either it runs
right after the failed Refresh, or it lands while that Refresh still
holds refreshRunning and is coalesced into a trailing refresh. Both
paths read the new route set and drop the old one, so the check sees
no route.

Gate the retry hook on a channel that the test releases after that
check. The real timer, retry bookkeeping and coalescing still run.
Production retry delays (5s/15s/60s) are unchanged.
Intercept mode on macOS creates a _ctrld group and exempts its GID from
the pf redirect. ctrld took the first free GID from 350, but every Nix
installer for macOS (Lix, Determinate, the official installer,
nix-darwin) creates its nixbld group at exactly 350 and stops with
"GID already exists" when it is taken. The group was never removed, so
uninstalling ctrld did not free it either.

Pick the GID from 600-699 instead: above Apple's system groups and the
first local user, and clear of Nix (350, 30000) and nix-darwin's own
service groups (534, 535). On start, an existing group outside the
range, or one whose GID another group also uses (locally or in a bound
LDAP/Active Directory node, via dscl /Search), moves to a free GID in
the range. A shared GID would also exempt the other software's DNS. If
the move fails the old GID is kept, so intercept still starts. A good
GID is never rewritten, and a directory search that fails or takes over
5s is not treated as a clash. Uninstall now deletes the group.
…ults read

The real-defaults run of test-postinstall-provision-failure.sh hard-coded
that macOS 'defaults read' prints a raw 0x01 byte as the text \001. That is
true on gitlab-runner-arm02 (macOS 26.2) but not on gitlab-runner-arm01
(macOS 27.0.1), which prints the raw byte, so test:pkg-postinstall:macos
failed on every arm01 run since 2026-10-27 and passed on arm02, which made
the job look flaky.

The postinstall contract is only that the preflight lets a non-whitespace
control character through and hands ctrld exactly what 'defaults read'
printed. In real-defaults mode the case now reads the same fixture plist
with the same command and asserts ctrld got that text byte for byte. It
logs the macOS version and the bytes so a runner difference is visible.
The stubbed mode still pins the \001 text.

The postinstall preflight comment claimed control characters could only
arrive as escaped text. It now says either form can arrive. Comment only:
ctrld still rejects the raw byte as a control character.
…s no reply

On macOS, upstream.os binds each query to the stored default-route
source. With a full-tunnel VPN that source can stay the physical
address while the route to a tunnel-only resolver goes through utun.
The query then leaves on the physical interface, no reply comes back,
and the #581 retry never runs because it only covers dial/write
unreachable errors.

Retry route-selected after a read timeout as well, but only when the
kernel's route to that server picks a different source than the bound
one, so a plain slow LAN resolver is not queried twice. The synthetic
76.76.2.0 fallback stays excluded.

After a route-selected retry is answered, later queries to that server
skip the bound send until the stored source changes or the
route-selected send fails, so only the first query after a network
change waits for the timeout. A warning names the server, reason and
source once per switch, and an info line marks the switch back.
On Windows `dns` intercept, the first probe of a heal cycle now waits an
extra 15 s (nrptProbeLateGrace) after the 2 s timeout. A probe that
reaches ctrld in that window proves the NRPT rule routes, so the cycle
ends with a warn log and no policy refresh, paramchange, flush or
two-phase recovery. A probe that never arrives still follows the
existing bounded retries and heal path.

On the affected host a forced RefreshPolicyEx holds the DNS Client for
~7 s (median of 118), so each retry made the next probe late and
extended the post-boot stall to 1-2.5 min.

Health ticks and the retry ladder keep the 2 s probe. The late window
honours shutdown through the same revocation poll.
Network-change recovery in intercept mode exempts the new network's
nameservers by calling exemptVPNDNSServers with that list only. On macOS
the callback rebuilds the whole pf anchor from its argument, so the
interface-scoped VPN DNS exemptions were dropped: the Tailscale utun
lost its passthrough rules and went back into the tunnel intercept
rules.

The VPN DNS refresh at the end of recovery did not repair it. It
compares the discovered set with the last set that it applied, both
were still the Tailscale set, and it logged "exemptions unchanged" and
skipped the rewrite. The recovery anchor stayed until the pf watchdog
forced a full reload, which rebuilt it from CurrentExemptions.

Recovery now writes the current VPN DNS exemptions followed by the
recovery nameservers that are not VPN DNS servers. The anchor keeps
the VPN interface rules through and after recovery, and the refresh
correctly finds nothing to change.
ctrld installs no Network Extension, so any enabled DNS proxy
configuration in the macOS Network Extension store belongs to another
product. macOS gives that extension the DNS traffic of every process,
ctrld's own lookups included. When it sends them on from its own socket,
pf's group exemption no longer matches and the lookups come back to
ctrld's listener: the self loop in #659. A customer traced their loop
to a Cisco Umbrella DNS proxy left enabled after an MDM removal.

ctrld already logs that store as ne_configurations, but the proxy is one
entry among many. Derive dns_proxies_enabled (app:provider of each
enabled dns_proxy) from the same read, add it to the start context and
to every self loop report, and warn once at intercept start when it is
not empty, so a log shows the likely cause before any lookup fails.

No new host read. Product bundle IDs only.
…nt prerequisite

Windows only loads a GP-store NRPT key during Group Policy processing.
A Dnscache paramchange plus a cache flush does not load a key written
straight into the registry (ctrld-qa lab, PARAMCHANGE_NOT_LOADED, 2 of 2).

ctrld will not call RefreshPolicyEx for an administrator rule it has not
proven, because that re-runs all machine Group Policy. Document that
tooling writing the key directly must run its own Group Policy refresh,
how ctrld behaves until the rule is loaded, and that gpupdate does not
trigger the network-event delayed re-checks.
@cuonglm cuonglm changed the title Release branch v1.5.10 Release v1.5.10 Nov 5, 2026
@cuonglm
cuonglm merged commit 5b15241 into v1.0 Nov 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants