mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Fix logical error in d0ae3f5a4d
The code which checked for a possible local answer to a domain, like --address=/example.com/1.2.3.4 could return false positives, causing upstream NXDOMAIN replies to be rewritten as NOERROR. Thanks to Dominik DL6ER for the bug report and analysis.
This commit is contained in:
@@ -289,10 +289,17 @@ int filter_servers(int seed, int flags, int *lowout, int *highout)
|
||||
|
||||
#define SERV_LOCAL_ADDRESS (SERV_6ADDR | SERV_4ADDR | SERV_ALL_ZEROS)
|
||||
|
||||
for (i = nlow; (flags & F_CONFIG) && i < nhigh && (daemon->serverarray[i]->flags & SERV_LOCAL_ADDRESS); i++);
|
||||
|
||||
if (i != nlow)
|
||||
nhigh = i;
|
||||
if (flags & F_CONFIG)
|
||||
{
|
||||
/* We're just lookin for any matches that return an RR. */
|
||||
for (i = nlow; i < nhigh; i++)
|
||||
if (daemon->serverarray[i]->flags & SERV_LOCAL_ADDRESS)
|
||||
break;
|
||||
|
||||
/* failed, return failure. */
|
||||
if (i == nhigh)
|
||||
nhigh = nlow;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = nlow; i < nhigh && (daemon->serverarray[i]->flags & SERV_6ADDR); i++);
|
||||
|
||||
Reference in New Issue
Block a user