Pull request: dnsforward: fix infinite loop

Merge in DNS/adguard-home from 2619-infinite-loop to master

Updates #2619.

Squashed commit of the following:

commit 425fde3f476349571036b9b95c9d0a33703270ee
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Feb 2 13:08:52 2021 +0300

    dnsforward: fix infinite loop
This commit is contained in:
Ainar Garipov 2021-02-02 13:35:23 +03:00
parent 39f6689b39
commit f5c47b6193
2 changed files with 4 additions and 1 deletions

View File

@ -212,7 +212,7 @@ func (s *Server) Prepare(config *ServerConfig) error {
// Log and go on. // Log and go on.
// //
// TODO(a.garipov): The Snap problem can probably be solved if // TODO(a.garipov): The Snap problem can probably be solved if
// we add the netlink-coinnector interface plug. // we add the netlink-connector interface plug.
log.Error("cannot initialize ipset: %s", err) log.Error("cannot initialize ipset: %s", err)
} }

View File

@ -242,6 +242,9 @@ func (c *ipsetCtx) lookupHost(host string) (sets []ipsetProps) {
} }
i = strings.Index(host, ".") i = strings.Index(host, ".")
if i == -1 {
break
}
} }
// Check the root catch-all one. // Check the root catch-all one.