mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-30 21:28:34 +00:00
connect() UDP sockets to upstream DNS servers to mitigate SAD DNS attack.
https://www.saddns.net/ When making a socket to talk to an upstream DNS server via UDP, call connect() to bind the socket to receiving replies from only that one server. This mitigates the SAD poisoning attack. Note that in some circumstances, this will slightly increase resource use: previously, when forwarding the a query to multiple servers in parallel, one socket would commonly be used. Now, a socket has to be created and connect()ed for each server.
This commit is contained in:
2 files changed
+29
-27
No files matched your search
+1
-2
@@ -41,8 +41,7 @@ void loop_send_probes(void)
|
||||
if ((fd = allocate_rfd(&rfds, serv)) == -1)
|
||||
continue;
|
||||
|
||||
while (retry_send(sendto(fd, daemon->packet, len, 0,
|
||||
&serv->addr.sa, sa_len(&serv->addr))));
|
||||
while (retry_send(send(fd, daemon->packet, len, 0)));
|
||||
}
|
||||
|
||||
free_rfds(&rfds);
|
||||
|
||||
Reference in new issue
Block a user