Correctly recognize .255 addresses as link-local when looking for interfaces

This commit is contained in:
Nick Mathewson 2010-05-18 13:55:32 -04:00
parent bda21e7ff9
commit 8c3452bcb2

View File

@ -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,