silently drop unicast questions that dont originate from port 5353
authorJohn Crispin <blogic@openwrt.org>
Thu, 4 Sep 2014 15:44:46 +0000 (17:44 +0200)
committerJohn Crispin <blogic@openwrt.org>
Thu, 4 Sep 2014 15:44:46 +0000 (17:44 +0200)
Signed-off-by: John Crispin <blogic@openwrt.org>
dns.c

diff --git a/dns.c b/dns.c
index df855ebdeb189f86393de41eb0efef65da12765f..3f6ecbe3988614105d402564acce04fe5acb08ee 100644 (file)
--- a/dns.c
+++ b/dns.c
@@ -359,6 +359,10 @@ dns_handle_packet(struct interface *iface, struct sockaddr *s, uint16_t port, ui
                return;
        }
 
+       if (h->questions && !iface->multicast && port != 5353)
+               // silently drop unicast questions that dont originate from port 5353  
+               return;
+
        while (h->questions-- > 0) {
                char *name = dns_consume_name(buffer, len, &b, &rlen);
                struct dns_question *q;