]> git.meshlink.io Git - catta/commitdiff
CVE-2009-0758: Reflector creates packet storm on legacy unicast traffic
authorRob Leslie <rob@mars.org>
Tue, 31 Mar 2009 23:32:33 +0000 (01:32 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 31 Mar 2009 23:32:33 +0000 (01:32 +0200)
Fixes rhbz #488314.

avahi-core/server.c

index 73ae1cb17c074817c6f2104399d89b7beabaea3e..bb625a577ca123e4fb90a771400425d9e0065785 100644 (file)
@@ -844,7 +844,7 @@ static int originates_from_local_legacy_unicast_socket(AvahiServer *s, const Ava
         if (getsockname(s->fd_legacy_unicast_ipv4, (struct sockaddr*) &lsa, &l) != 0)
             avahi_log_warn("getsockname(): %s", strerror(errno));
         else
-            return lsa.sin_port == port;
+            return avahi_port_from_sockaddr((struct sockaddr*) &lsa) == port;
 
     }
 
@@ -855,7 +855,7 @@ static int originates_from_local_legacy_unicast_socket(AvahiServer *s, const Ava
         if (getsockname(s->fd_legacy_unicast_ipv6, (struct sockaddr*) &lsa, &l) != 0)
             avahi_log_warn("getsockname(): %s", strerror(errno));
         else
-            return lsa.sin6_port == port;
+            return avahi_port_from_sockaddr((struct sockaddr*) &lsa) == port;
     }
 
     return 0;