Add workaround for resolver/compat integration

This commit is contained in:
Daniel
2021-11-29 16:13:08 +01:00
parent 3bcb6f377c
commit dc31400caa
6 changed files with 32 additions and 15 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/safing/portbase/log"
"github.com/safing/portbase/modules"
"github.com/safing/portmaster/netenv"
"github.com/safing/portmaster/resolver"
"github.com/tevino/abool"
)
@@ -28,6 +29,12 @@ var (
func init() {
module = modules.Register("compat", prep, start, stop, "base", "network", "interception", "netenv", "notifications")
// Workaround resolver integration.
// See resolver/compat.go for details.
resolver.CompatDNSCheckInternalDomainScope = DNSCheckInternalDomainScope
resolver.CompatSelfCheckIsFailing = SelfCheckIsFailing
resolver.CompatSubmitDNSCheckDomain = SubmitDNSCheckDomain
}
func prep() error {

View File

@@ -12,6 +12,7 @@ import (
"github.com/safing/portbase/log"
"github.com/safing/portbase/rng"
"github.com/safing/portmaster/network/packet"
"github.com/safing/portmaster/resolver"
)
var (
@@ -25,7 +26,7 @@ var (
systemIntegrationCheckPackets = make(chan packet.Packet, 1)
systemIntegrationCheckWaitDuration = 3 * time.Second
DNSCheckInternalDomainScope string
DNSCheckInternalDomainScope = ".self-check." + resolver.InternalSpecialUseDomain
dnsCheckReceivedDomain = make(chan string, 1)
dnsCheckWaitDuration = 3 * time.Second
dnsCheckAnswerLock sync.Mutex