diff --git a/dnsforward/ipset_integration_test.go b/dnsforward/ipset_integration_test.go index e91ec32d5d6..a3a4a0b9f95 100644 --- a/dnsforward/ipset_integration_test.go +++ b/dnsforward/ipset_integration_test.go @@ -1,3 +1,4 @@ +// +build linux // +build integration package dnsforward diff --git a/dnsforward/ipset.go b/dnsforward/ipset_linux.go similarity index 100% rename from dnsforward/ipset.go rename to dnsforward/ipset_linux.go diff --git a/dnsforward/ipset_other.go b/dnsforward/ipset_other.go new file mode 100644 index 00000000000..2266eb94697 --- /dev/null +++ b/dnsforward/ipset_other.go @@ -0,0 +1,25 @@ +// +build !linux + +package dnsforward + +import ( + "github.com/AdguardTeam/golibs/log" +) + +type ipsetCtx struct {} + +// Convert configuration settings to an internal map and check ipsets +// DOMAIN[,DOMAIN].../IPSET1_NAME[,IPSET2_NAME]... +// config parameter may be nil +func (c *ipsetCtx) init(ipsetConfig []string, config *interface{}) error { + if len(ipsetConfig) != 0 { + log.Info("IPSET: ignoring %d ipset configuration lines; " + + "ipset support is only available on Linux", + len(ipsetConfig)) + } + return nil +} + +func (c *ipsetCtx) process(ctx *dnsContext) int { + return resultDone +}