glibc/glibc-2.12.1-assign-global-scope-to-RFC-1918-addresses.patch

45 lines
2 KiB
Diff
Raw Permalink Normal View History

2012-02-01 14:42:15 +04:00
See https://qa.mandriva.com/show_bug.cgi?id=58834
Patch from bug report, updated for glibc 2.12.1 in Mandriva
diff -p -up glibc-2.12.1/posix/gai.conf.orig glibc-2.12.1/posix/gai.conf
--- glibc-2.12.1/posix/gai.conf.orig 2010-07-27 08:34:39.000000000 -0300
+++ glibc-2.12.1/posix/gai.conf 2010-08-25 11:27:32.302898528 -0300
@@ -56,9 +56,7 @@
#
# scopev4 <mask> <value>
# 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
@@ -69,8 +67,8 @@
#
# 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:
+# have the same scope and are therefore not sorted first. Therefore,
+# the following settings are used by default on this system:
#
#scopev4 ::ffff:169.254.0.0/112 2
#scopev4 ::ffff:127.0.0.0/104 2
diff -p -up glibc-2.12.1/sysdeps/posix/getaddrinfo.c.orig glibc-2.12.1/sysdeps/posix/getaddrinfo.c
--- glibc-2.12.1/sysdeps/posix/getaddrinfo.c.orig 2010-07-27 08:34:39.000000000 -0300
+++ glibc-2.12.1/sysdeps/posix/getaddrinfo.c 2010-08-25 11:24:03.960253468 -0300
@@ -1099,10 +1099,12 @@ static const struct scopeentry
/* 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 }
};