Release v1.5.4#323
Merged
Merged
Conversation
f61c5af to
b770089
Compare
When IPv6 is available locally but the selected IPv6 DoH endpoint is unroutable (e.g. dialing [2606:1a40::22]:443 returns "no route to host" while IPv4 stays usable), ctrld re-bootstrapped and re-dialed the endpoint every ~2s. A weekend soak produced ~46.7k "no route to host" lines, with the dial/health-check loop dominating the log during bad windows. Add bounded backoff/suppression for network-unreachable endpoints at two levels: - ParallelDialer (internal/net): track dial addresses that fail with ENETUNREACH/EHOSTUNREACH and skip them for an exponentially growing, bounded window (5s -> 60s). A successful dial clears the entry immediately, so recovery is preserved when the route returns. When every candidate is suppressed the dial fails fast and quietly instead of hammering known-unroutable addresses. - Upstream recovery loop (cmd/cli): demote unreachable check failures to debug and back off the retry cadence (2s -> 60s) for an unreachable streak; any other failure resets to the base cadence. The new IsUnreachable classifier lives in internal/net and is reused by cmd/cli's errNetworkError, so the unreachable-errno matching has a single definition. Note the explicit winsock constants (10051/10065) are required on Windows: syscall.ENETUNREACH/EHOSTUNREACH are Go's portable "invented" values and never equal the raw WSA codes a failing connect surfaces. Suppression and backoff are always bounded, so IPv6 is never disabled until restart and recovers on its own once the route is back. Split-stack selection and the #549 macOS intercept recovery work are untouched. Adds unit tests for the classifier, the dialer's suppression tracker, and the recovery backoff schedule.
Windows DNS intercept mode runs an NRPT health monitor that restores the catch-all rule and re-signals DNS Client whenever Windows stops routing queries to the local listener. When another agent (MDM, VPN, GPO) keeps putting NRPT back into a broken state, that loop never converges: ctrld repeatedly calls RefreshPolicyEx, Dnscache paramchange, and flushes the DNS cache, producing continuous flash writes and SIEM noise while never fixing anything. Add a recovery limiter that trips after a configurable number of consecutive recovery flows and enters a cooldown, during which recovery is suppressed (logged at most once every 5 minutes). Clearing the circuit requires two consecutive stable health successes rather than one, because a probe can pass briefly right after delete/re-add even when the underlying NRPT state is still broken. New [service] options gate the behavior and default to the previous unlimited behavior: - nrpt_recovery_max_attempts (default 0 = unlimited) - nrpt_recovery_cooldown (default 30m) Also collapse the repeated refresh + paramchange + flush sequence into a single signalNRPTChange() helper, and make cleanGPPath / cleanEmptyNRPTParent only mutate the registry and report whether cleanup happened, so callers send exactly one DNS Client change signal instead of several. When the GP DnsPolicyConfig parent exists but is empty, nrptProbeAndHeal now cleans it and signals once before spending the normal policy-refresh retry budget, since those retries cannot succeed while DNS Client is stuck in GP mode. Add unit tests for the limiter's cooldown, stable-reset, and unlimited paths, and document the new options and the empty-GP repro.
b770089 to
41ca698
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Minor Release
This contains some bug fixes.
Fixed
pfwatchdog exec storms.