about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-05-18 16:58:36 +0000
committerUlrich Drepper <drepper@redhat.com>2006-05-18 16:58:36 +0000
commit6e2a7825284e41f2336b0cb5a98609ff486e85fa (patch)
tree8084e65d95ff9acac81496574d841ae8c5d5011c /sysdeps
parent758b9d7efe599e3de3472593b6f8f03cfc29ea92 (diff)
downloadglibc-6e2a7825284e41f2336b0cb5a98609ff486e85fa.tar.gz
glibc-6e2a7825284e41f2336b0cb5a98609ff486e85fa.tar.xz
glibc-6e2a7825284e41f2336b0cb5a98609ff486e85fa.zip
* sysdeps/posix/getaddrinfo.c: Add unique labels to the default
	RFC3484 precedence table for fec0::/10 and fc00::/7 (site-local
	and ULA respectively). Set precedence for IPv4 address to 10 as
	defined in RFC3484 for preferring IPv6.
	* posix/gai.conf: Update to match the new default tables.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/posix/getaddrinfo.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index a78c670bfb..a35b8662d5 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -1202,6 +1202,21 @@ static const struct prefixentry default_labels[] =
 	= { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 			  0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } },
       96, 4 },
+    /* The next two entries differ from RFC 3484.  We need to treat
+       IPv6 site-local addresses special because they are never NATed,
+       unlike site-locale IPv4 addresses.  If this would not happen, on
+       machines which have only IPv4 and IPv6 site-local addresses, the
+       sorting would prefer the IPv6 site-local addresses, causing
+       unnecessary delays when trying to connect to a global IPv6 address
+       through a site-local IPv6 address.  */
+    { { .in6_u
+	= { .u6_addr8 = { 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
+      10, 5 },
+    { { .in6_u
+	= { .u6_addr8 = { 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
+      7, 6 },
     { { .in6_u
 	= { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
@@ -1231,7 +1246,7 @@ static const struct prefixentry default_precedence[] =
     { { .in6_u
 	= { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 			  0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } },
-      96, 100 },
+      96, 10 },
     { { .in6_u
 	= { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },