Pull request: 1730 bogus cidr
Merge in DNS/adguard-home from 1730-bogus-cidr to master Closes #1730. Squashed commit of the following: commit 0be54259ca4edb8752e9f7e5ea5104a2b51ed440 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Jan 25 18:50:01 2022 +0300 all: imp log of changes commit 59fb7a8c469216823ff54621ec40a4d084836132 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Jan 25 18:46:34 2022 +0300 all: log changes commit 9206b13dd715fdf1180d1d572d1b80024b9e6592 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Jan 25 18:41:26 2022 +0300 all: upd dnsproxy
This commit is contained in:
parent
dc14f89c9f
commit
0b72bcc5a1
|
@ -19,6 +19,11 @@ and this project adheres to
|
||||||
|
|
||||||
- `windows/arm64` support ([#3057]).
|
- `windows/arm64` support ([#3057]).
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- The `dns.bogus_nxdomain` configuration file parameter now supports CIDR
|
||||||
|
notation alongside IP addresses ([#1730]).
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -31,6 +36,7 @@ and this project adheres to
|
||||||
|
|
||||||
- Go 1.16 support.
|
- Go 1.16 support.
|
||||||
|
|
||||||
|
[#1730]: https://github.com/AdguardTeam/AdGuardHome/issues/1730
|
||||||
[#3057]: https://github.com/AdguardTeam/AdGuardHome/issues/3057
|
[#3057]: https://github.com/AdguardTeam/AdGuardHome/issues/3057
|
||||||
|
|
||||||
|
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module github.com/AdguardTeam/AdGuardHome
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/AdguardTeam/dnsproxy v0.40.6
|
github.com/AdguardTeam/dnsproxy v0.41.0
|
||||||
github.com/AdguardTeam/golibs v0.10.4
|
github.com/AdguardTeam/golibs v0.10.4
|
||||||
github.com/AdguardTeam/urlfilter v0.15.2
|
github.com/AdguardTeam/urlfilter v0.15.2
|
||||||
github.com/NYTimes/gziphandler v1.1.1
|
github.com/NYTimes/gziphandler v1.1.1
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -7,8 +7,8 @@ dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBr
|
||||||
dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4=
|
dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4=
|
||||||
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
|
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
|
||||||
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
||||||
github.com/AdguardTeam/dnsproxy v0.40.6 h1:cTyzjiDrTk4vOXixLsWZ4Xjpqy6pqjTY++Tndq3bEf4=
|
github.com/AdguardTeam/dnsproxy v0.41.0 h1:DZlzFEzDV/eKJz8b+dYctAYPrQscdsvbtBc/eFU+e9U=
|
||||||
github.com/AdguardTeam/dnsproxy v0.40.6/go.mod h1:PZ9l22h3Er+5mxFQB7oHZMTvx+aa9R6LbzA/ikXQlS0=
|
github.com/AdguardTeam/dnsproxy v0.41.0/go.mod h1:PZ9l22h3Er+5mxFQB7oHZMTvx+aa9R6LbzA/ikXQlS0=
|
||||||
github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
|
github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
|
||||||
github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
|
github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
|
||||||
github.com/AdguardTeam/golibs v0.10.3/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw=
|
github.com/AdguardTeam/golibs v0.10.3/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw=
|
||||||
|
|
|
@ -243,15 +243,15 @@ func (s *Server) createProxyConfig() (proxy.Config, error) {
|
||||||
proxyConfig.FastestPingTimeout = s.conf.FastestTimeout.Duration
|
proxyConfig.FastestPingTimeout = s.conf.FastestTimeout.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(s.conf.BogusNXDomain) > 0 {
|
for i, s := range s.conf.BogusNXDomain {
|
||||||
for _, s := range s.conf.BogusNXDomain {
|
subnet, err := netutil.ParseSubnet(s)
|
||||||
ip := net.ParseIP(s)
|
if err != nil {
|
||||||
if ip == nil {
|
log.Error("subnet at index %d: %s", i, err)
|
||||||
log.Error("Invalid bogus IP: %s", s)
|
|
||||||
} else {
|
continue
|
||||||
proxyConfig.BogusNXDomain = append(proxyConfig.BogusNXDomain, ip)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proxyConfig.BogusNXDomain = append(proxyConfig.BogusNXDomain, subnet)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TLS settings
|
// TLS settings
|
||||||
|
|
|
@ -306,7 +306,7 @@ func assertLogEntry(t *testing.T, entry *logEntry, host string, answer, client n
|
||||||
require.NoError(t, msg.Unpack(entry.Answer))
|
require.NoError(t, msg.Unpack(entry.Answer))
|
||||||
require.Len(t, msg.Answer, 1)
|
require.Len(t, msg.Answer, 1)
|
||||||
|
|
||||||
ip := proxyutil.GetIPFromDNSRecord(msg.Answer[0]).To16()
|
ip := proxyutil.IPFromRR(msg.Answer[0]).To16()
|
||||||
assert.Equal(t, answer, ip)
|
assert.Equal(t, answer, ip)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue