From 6bf4a686f5a8fc2df9b3406fe3954c224a3846ba Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 6 Mar 2007 14:53:08 +0000 Subject: [PATCH] * sysdeps/posix/getaddrinfo.c (get_scope): Correct test for 172.16/12 address range. --- ChangeLog | 5 +++++ sysdeps/posix/getaddrinfo.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6256913526..8d27b4ca17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-06 Ulrich Drepper + + * sysdeps/posix/getaddrinfo.c (get_scope): Correct test for + 172.16/12 address range. + 2007-03-02 Jakub Jelinek * sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_request): Retry with diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index b4966852a7..da48d46afe 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -1157,7 +1157,7 @@ get_scope (const struct sockaddr_storage *ss) 169.254/16 and 127/8 are link-local. */ if ((addr[0] == 169 && addr[1] == 254) || addr[0] == 127) scope = 2; - else if (addr[0] == 10 || (addr[0] == 172 && addr[1] == 16) + else if (addr[0] == 10 || (addr[0] == 172 && (addr[1] & 0xf0) == 16) || (addr[0] == 192 && addr[1] == 168)) scope = 5; else -- 2.11.4.GIT