Code: Access control subnets settings for Unbound

This commit is contained in:
Quentin McGaw
2021-01-03 00:36:03 +00:00
parent 31cf5d4a5a
commit 007a4536c7
3 changed files with 13 additions and 3 deletions

2
go.mod
View File

@@ -6,7 +6,7 @@ require (
github.com/fatih/color v1.10.0
github.com/golang/mock v1.4.4
github.com/kyokomi/emoji v2.2.4+incompatible
github.com/qdm12/dns v1.4.0-rc1.0.20210102203614-d09f0dbb584a
github.com/qdm12/dns v1.4.0-rc2
github.com/qdm12/golibs v0.0.0-20210102020307-17bc97def973
github.com/qdm12/ss-server v0.1.0
github.com/qdm12/updated v0.0.0-20210102005021-dd457d77f94a

4
go.sum
View File

@@ -92,8 +92,8 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/qdm12/dns v1.4.0-rc1.0.20210102203614-d09f0dbb584a h1:ZKpp1b1XRuV7sh2rZtUqeNVihTJXvhGFC5UTfQb7BZU=
github.com/qdm12/dns v1.4.0-rc1.0.20210102203614-d09f0dbb584a/go.mod h1:JhUKBhuDRYBUQ2XwW/jbeWx/qS0sSJjIFjGTCFGP5I8=
github.com/qdm12/dns v1.4.0-rc2 h1:Xh21ebk9pTe6SXwHKdfrK/i3xOr2bKQCy9NJCOsDqNs=
github.com/qdm12/dns v1.4.0-rc2/go.mod h1:JhUKBhuDRYBUQ2XwW/jbeWx/qS0sSJjIFjGTCFGP5I8=
github.com/qdm12/golibs v0.0.0-20201227203847-2fd99ffdfdba/go.mod h1:pikkTN7g7zRuuAnERwqW1yAFq6pYmxrxpjiwGvb0Ysc=
github.com/qdm12/golibs v0.0.0-20210102020307-17bc97def973 h1:5YeJALmDjvg2wSi6XB8MpQQekbT/eBnwGahJrh01HHQ=
github.com/qdm12/golibs v0.0.0-20210102020307-17bc97def973/go.mod h1:pikkTN7g7zRuuAnERwqW1yAFq6pYmxrxpjiwGvb0Ysc=

View File

@@ -153,5 +153,15 @@ func getUnboundSettings(reader params.Reader) (settings unboundmodels.Settings,
if err != nil {
return settings, err
}
settings.AccessControl.Allowed = []net.IPNet{
{
IP: net.IPv4zero,
Mask: net.IPv4Mask(0, 0, 0, 0),
},
{
IP: net.IPv6zero,
Mask: net.IPMask{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
},
}
return settings, nil
}