mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-12-04 22:08:27 +00:00
Ignore DNS queries from port 0: http://www.ietf.org/mail-archive/web/dnsop/current/msg11441.html
This commit is contained in:
1 parent
3e21a1a6fa
commit
2a7a2b84ec
1 file changed
+15
-2
+15
-2
@@ -1076,9 +1076,22 @@ void receive_query(struct listener *listen, time_t now)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
source_addr.sa.sa_family = listen->family;
|
source_addr.sa.sa_family = listen->family;
|
||||||
|
|
||||||
|
if (listen->family == AF_INET)
|
||||||
|
{
|
||||||
|
/* Source-port == 0 is an error, we can't send back to that.
|
||||||
|
http://www.ietf.org/mail-archive/web/dnsop/current/msg11441.html */
|
||||||
|
if (source_addr.in.sin_port == 0)
|
||||||
|
return;
|
||||||
|
}
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
if (listen->family == AF_INET6)
|
else
|
||||||
source_addr.in6.sin6_flowinfo = 0;
|
{
|
||||||
|
/* Source-port == 0 is an error, we can't send back to that. */
|
||||||
|
if (source_addr.in6.sin6_port == 0)
|
||||||
|
return;
|
||||||
|
source_addr.in6.sin6_flowinfo = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We can be configured to only accept queries from at-most-one-hop-away addresses. */
|
/* We can be configured to only accept queries from at-most-one-hop-away addresses. */
|
||||||
|
|||||||
Reference in new issue
Block a user