Pull request: all: do not check local domains when dhcp srv is off

Updates #3028.

Squashed commit of the following:

commit 49d3ca5c9de0468ccb1792e9de263fd66e30d79c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 29 15:35:32 2021 +0300

    all: do not check local domains when dhcp srv is off
This commit is contained in:
Ainar Garipov
2021-04-29 16:00:07 +03:00
parent c8092fe34d
commit a06543a1d5
6 changed files with 30 additions and 6 deletions

View File

@@ -249,6 +249,10 @@ func (s *Server) hostToIP(host string) (ip net.IP, ok bool) {
//
// TODO(a.garipov): Adapt to AAAA as well.
func (s *Server) processInternalHosts(dctx *dnsContext) (rc resultCode) {
if !s.dhcpServer.Enabled() {
return resultCodeSuccess
}
req := dctx.proxyCtx.Req
q := req.Question[0]