2010-04-06 Ulrich Drepper * sysdeps/posix/getaddrinfo.c (default_scopes): Assign global scope to RFC 1918 addresses. * posix/gai.conf: Document difference from RFC 3484. --- ./posix/gai.conf.orig 2010-04-16 16:12:00.022336293 +0200 +++ ./posix/gai.conf 2010-04-16 16:20:06.761085950 +0200 @@ -41,7 +41,7 @@ # # precedence # Add another rule to the RFC 3484 precedence table. See section 2.1 -# and 10.3 in RFC 3484. The default is: +# and 10.3 in RFC 3484. The RFC requires: # #precedence ::1/128 50 #precedence ::/0 40 @@ -56,9 +56,7 @@ # # scopev4 # Add another rule to the RFC 3484 scope table for IPv4 addresses. -# By default the scope IDs described in section 3.2 in RFC 3484 are -# used. Changing these defaults should hardly ever be necessary. -# The defaults are equivalent to: +# The definitions in RFC 3484 are equivalent to: # #scopev4 ::ffff:169.254.0.0/112 2 #scopev4 ::ffff:127.0.0.0/104 2 @@ -66,3 +64,14 @@ #scopev4 ::ffff:172.16.0.0/108 5 #scopev4 ::ffff:192.168.0.0/112 5 #scopev4 ::ffff:0.0.0.0/96 14 +# +# For sites which use site-local IPv4 addresses behind NAT there is +# the problem that even if IPv4 addresses are preferred they do not +# have the same scope and are therefore not sorted first. To change +# this use only these rules: +# +#scopev4 ::ffff:169.254.0.0/112 2 +#scopev4 ::ffff:127.0.0.0/104 2 +#scopev4 ::ffff:0.0.0.0/96 14 +# +# This is what the Red Hat / Ubuntu setting currently uses. --- ./sysdeps/posix/getaddrinfo.c.orig 2010-04-16 16:12:09.543586079 +0200 +++ ./sysdeps/posix/getaddrinfo.c 2010-04-16 16:19:31.941086318 +0200 @@ -1102,10 +1102,12 @@ /* Link-local addresses: scope 2. */ { { { 169, 254, 0, 0 } }, htonl_c (0xffff0000), 2 }, { { { 127, 0, 0, 0 } }, htonl_c (0xff000000), 2 }, +#if 0 /* Site-local addresses: scope 5. */ { { { 10, 0, 0, 0 } }, htonl_c (0xff000000), 5 }, { { { 172, 16, 0, 0 } }, htonl_c (0xfff00000), 5 }, { { { 192, 168, 0, 0 } }, htonl_c (0xffff0000), 5 }, +#endif /* Default: scope 14. */ { { { 0, 0, 0, 0 } }, htonl_c (0x00000000), 14 } };