]> git.meshlink.io Git - catta/blobdiff - avahi-core/server.c
Don't get confused by UDP packets with a source port that is zero
[catta] / avahi-core / server.c
index c4980af5972171ba7f34b2090aa67cbb4951045a..11ab6cfde0ca69a79740e69913b1c4e5ca1991a3 100644 (file)
@@ -898,6 +898,12 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres
         return;
     }
 
+    if (port <= 0) {
+        /* This fixes RHBZ #475394 */
+        avahi_log_warn("Received packet from invalid source port.");
+        return;
+    }
+
     if (avahi_address_is_ipv4_in_ipv6(src_address))
         /* This is an IPv4 address encapsulated in IPv6, so let's ignore it. */
         return;