mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-16 13:17:19 +02:00
cmd/cli: skip upstream.os healthcheck when WFP loopback protect enabled
When WFP loopback protect is active, the upstream.os healthcheck will always fail because an external WFP block filter is interfering with plain DNS. This demotes those expected failures to debug level and returns errOsHealthcheckSuppressed so the recovery loop treats them as non-fatal, eliminating the log spam described in #526.
This commit is contained in:
committed by
Cuong Manh Le
parent
81aa6b237b
commit
1735d3d55b
@@ -1260,6 +1260,26 @@ func (p *prog) activateLoopbackWFPProtect(state *wfpState) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// osHealthcheckSuppressed reports whether the upstream.os healthcheck should
|
||||
// be skipped because DNS intercept mode is active and the WFP loopback protect
|
||||
// has been engaged. Loopback protect is only activated when an external WFP
|
||||
// block filter (e.g. OpenVPN's block-outside-dns) is interfering with DNS,
|
||||
// which is the same condition that makes the OS resolver healthcheck fail
|
||||
// every 2s with i/o timeout — so suppressing the check avoids the log spam
|
||||
// described in issue #526.
|
||||
func (p *prog) osHealthcheckSuppressed() bool {
|
||||
if !dnsIntercept || p.dnsInterceptState == nil {
|
||||
return false
|
||||
}
|
||||
state, ok := p.dnsInterceptState.(*wfpState)
|
||||
if !ok || state == nil {
|
||||
return false
|
||||
}
|
||||
state.mu.Lock()
|
||||
defer state.mu.Unlock()
|
||||
return state.loopbackProtectActive
|
||||
}
|
||||
|
||||
// deactivateLoopbackWFPProtectLocked is the lock-free inner implementation.
|
||||
// Caller must hold state.mu.
|
||||
func (p *prog) deactivateLoopbackWFPProtectLocked(state *wfpState) {
|
||||
|
||||
Reference in New Issue
Block a user