diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-12-11 20:57:45 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-12-12 19:21:24 +0100 |
commit | 3093047f1aa36bed8a37fa79004bf0ee287929f4 (patch) | |
tree | 4e41bdb20c519b49372158379e0f25f8413b78a1 | |
parent | 5cdcc2b1e250ba5b701d4094f9561ca957d08fc9 (diff) |
Don't get confused by UDP packets with a source port that is zero
This is a fix for rhbz 475394.
Problem identified by Hugo Dias.
-rw-r--r-- | avahi-core/server.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/avahi-core/server.c b/avahi-core/server.c index c4980af..11ab6cf 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -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; |