]> granicus.if.org Git - libevent/commitdiff
Correctly recognize .255 addresses as link-local when looking for interfaces
authorNick Mathewson <nickm@torproject.org>
Tue, 18 May 2010 17:55:32 +0000 (13:55 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 18 May 2010 17:55:32 +0000 (13:55 -0400)
evutil.c

index 639a51a3ce9138f84c8e14b412d8228c6954f724..f55d7355af6c825029b0cfc1a64c9bd614922090 100644 (file)
--- a/evutil.c
+++ b/evutil.c
@@ -492,7 +492,7 @@ evutil_check_interfaces(int force_recheck)
                /* We might have an IPv4 interface. */
                ev_uint32_t addr = ntohl(sin_out.sin_addr.s_addr);
                if (addr == 0 || (addr&0xff000000) == 127 ||
-                   (addr && 0xff) == 255 || (addr & 0xf0) == 14) {
+                   (addr & 0xff) == 255 || (addr & 0xf0) == 14) {
                        evutil_inet_ntop(AF_INET, &sin_out.sin_addr,
                            buf, sizeof(buf));
                        /* This is a reserved, ipv4compat, ipv4map, loopback,