mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-10-17 10:59:36 +00:00
fix: move fd-match guard out of loop in reply_query()
The `if (serv == last) return;` was inside the loop `for (serv = first; serv != last; ...)`, making it dead code — the loop condition ensures the body never runs when serv == last. Replies arriving on an unrecognised file descriptor were therefore never rejected by the fd check. Moving the guard after the loop causes it to fire when no server socket matches. Signed-off-by: Dominik <dl6er@dl6er.de>
This commit is contained in:
1 parent
5ea054b264
commit
68c149e9dd
1 file changed
+3
-3
+3
-3
@@ -1205,10 +1205,10 @@ void reply_query(int fd, time_t now)
|
||||
server = daemon->serverarray[serv];
|
||||
if (server->sfd && server->sfd->fd == fd)
|
||||
break;
|
||||
|
||||
if (serv == last)
|
||||
return;
|
||||
}
|
||||
|
||||
if (serv == last)
|
||||
return;
|
||||
}
|
||||
|
||||
/* spoof check: answer must come from known server, also
|
||||
|
||||
Reference in new issue
Block a user