mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-09-04 13:36:35 +02:00
macOS intercept mode fails totally on networks that provide no usable IPv4 DNS (e.g. IPv6-only iPhone tethering with 464XLAT): the pf ruleset blocks all outbound IPv6 port 53, and with no IPv4 DNS configured mDNSResponder emits no DNS packets at all, so pf has nothing to intercept while the Control D upstream stays provably healthy. When network-change recovery discovers no usable IPv4 DNS on the default-route service, set 127.0.0.1 as that service DNS so macOS can emit queries that land directly on the listener. The entry is removed when the network regains IPv4 DNS and on intercept shutdown; networks that provide IPv4 DNS are never modified. Runs on the already-debounced recovery path so interface flaps do not churn networksetup. Also fix the canceled-recovery state leak: the cancellation early return never reset recoveryBypass/recoveryRunning, so a flap burst ending in a canceled recovery left the daemon in bypass forever with the DNS watchdog disabled. Cleanup is generation-gated so a superseded recovery never clears state owned by its successor.
15 lines
599 B
Go
15 lines
599 B
Go
//go:build !darwin
|
|
|
|
package cli
|
|
|
|
// ensureInterceptDNSTarget is a no-op on non-Darwin platforms: the DNS-less
|
|
// network problem it solves is specific to macOS pf interception blocking
|
|
// IPv6 port 53 with no IPv4 fallback (issue #533). Windows intercept mode
|
|
// uses NRPT, which routes queries regardless of adapter DNS configuration.
|
|
func (p *prog) ensureInterceptDNSTarget(_ []string) {}
|
|
|
|
// removeInterceptDNSTarget is a no-op on non-Darwin platforms.
|
|
//
|
|
//lint:ignore U1000 called from Darwin-only intercept shutdown; kept for API symmetry.
|
|
func (p *prog) removeInterceptDNSTarget(_ string) {}
|