From: Fabrice Bellet Date: Thu, 13 Feb 2020 15:09:31 +0000 (+0100) Subject: interfaces: fix network to host conversion for private addresses X-Git-Tag: 0.1.17~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18145b31e71b1d3edccbd20101829bcb63a8d595;p=platform%2Fupstream%2Flibnice.git interfaces: fix network to host conversion for private addresses --- diff --git a/agent/interfaces.c b/agent/interfaces.c index bea9e77..a147808 100644 --- a/agent/interfaces.c +++ b/agent/interfaces.c @@ -216,19 +216,19 @@ nice_interfaces_is_private_ip (const struct sockaddr *_sa) if (sa.addr->sa_family == AF_INET) { /* 10.x.x.x/8 */ - if (sa.in->sin_addr.s_addr >> 24 == 0x0A) + if (g_ntohl (sa.in->sin_addr.s_addr) >> 24 == 0x0A) return TRUE; /* 172.16.0.0 - 172.31.255.255 = 172.16.0.0/10 */ - if (sa.in->sin_addr.s_addr >> 20 == 0xAC1) + if (g_ntohl (sa.in->sin_addr.s_addr) >> 20 == 0xAC1) return TRUE; /* 192.168.x.x/16 */ - if (sa.in->sin_addr.s_addr >> 16 == 0xC0A8) + if (g_ntohl (sa.in->sin_addr.s_addr) >> 16 == 0xC0A8) return TRUE; /* 169.254.x.x/16 (for APIPA) */ - if (sa.in->sin_addr.s_addr >> 16 == 0xA9FE) + if (g_ntohl (sa.in->sin_addr.s_addr) >> 16 == 0xA9FE) return TRUE; } else if (sa.addr->sa_family == AF_INET6) { /* fc00::/7 Unique local address (ULA) */