diff options
| author | Steinar H. Gunderson <sesse@google.com> | 2010-12-20 11:15:33 +0100 |
|---|---|---|
| committer | Steinar H. Gunderson <sesse@google.com> | 2010-12-20 11:15:33 +0100 |
| commit | d1624add2b73ce8ff7826ce27b1d6d6e35bb83a6 (patch) | |
| tree | cf01e16e86b8fc834fb9475e1d91ad48034adad2 /libc/netbsd/net | |
| parent | d4a65d28d4dd7dab4ad66d2d65903296d183d47c (diff) | |
| download | bionic-d1624add2b73ce8ff7826ce27b1d6d6e35bb83a6.zip bionic-d1624add2b73ce8ff7826ce27b1d6d6e35bb83a6.tar.gz bionic-d1624add2b73ce8ff7826ce27b1d6d6e35bb83a6.tar.bz2 | |
Don't treat private IPv4 addresses as being in a non-global scope. The effect of this change is essentially to prefer NATed IPv4 over 6to4.
Change-Id: I53a8613ca9eb61cac0bf18f0b5f98a2d35ab9c50
Diffstat (limited to 'libc/netbsd/net')
| -rw-r--r-- | libc/netbsd/net/getaddrinfo.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libc/netbsd/net/getaddrinfo.c b/libc/netbsd/net/getaddrinfo.c index 4510652..778f44c 100644 --- a/libc/netbsd/net/getaddrinfo.c +++ b/libc/netbsd/net/getaddrinfo.c @@ -1497,11 +1497,13 @@ _get_scope(const struct sockaddr *addr) if (IN_LOOPBACK(na) || /* 127.0.0.0/8 */ (na & 0xffff0000) == 0xa9fe0000) { /* 169.254.0.0/16 */ return IPV6_ADDR_SCOPE_LINKLOCAL; - } else if ((na & 0xff000000) == 0x0a000000 || /* 10.0.0.0/8 */ - (na & 0xfff00000) == 0xac100000 || /* 172.16.0.0/12 */ - (na & 0xffff0000) == 0xc0a80000) { /* 192.168.0.0/16 */ - return IPV6_ADDR_SCOPE_SITELOCAL; } else { + /* + * According to draft-ietf-6man-rfc3484-revise-01 section 2.3, + * it is best not to treat the private IPv4 ranges + * (10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16) as being + * in a special scope, so we don't. + */ return IPV6_ADDR_SCOPE_GLOBAL; } } else { |
