* sysdeps/posix/getaddrinfo.c (get_scope): Correct test for

172.16/12 address range.
This commit is contained in:
Ulrich Drepper 2007-03-06 14:53:08 +00:00
parent 0b3b1a0ce8
commit 6bf4a686f5
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2007-03-06 Ulrich Drepper <drepper@redhat.com>
* sysdeps/posix/getaddrinfo.c (get_scope): Correct test for
172.16/12 address range.
2007-03-02 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_request): Retry with

View File

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