* [PATCH] scopev4 in /etc/gai.conf
@ 2008-03-25 16:08 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2008-03-25 16:08 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
Hi!
When scopev4 is specified in /etc/gai.conf without /prefix_len, for IPv4
address that's just that address, i.e. bits 32 (resp. 128 for v4 mapped
address). E.g.
scopev4 172.16.0.1 7
and
scopev4 172.16.0.1/32 7
are handled the same. But if /prefix_len isn't present for
IN6_IS_ADDR_V4_MAPPED address, the entry is handled as invalid (cp == NULL,
so satisfies a few initial conditions, but then fails the bits >= 96
test, because it has been initialized to 32. I assume it should default to
128, right? Also, the example scopev4 entries in posix/gai.conf use
scopev4 ::ffff:0.0.0.0 14
entry, which ATM isn't parsed at all, with the getaddrinfo.c change below
would be parsed as ::ffff:0.0.0.0/128 14, while I believe the nullbits
entry should have netmask 0, i.e. ::ffff:0.0.0.0/96. If the last number is
14, that's not a big deal, as getaddrinfo.c will then magically add
scope_nullbits entry, but still it would be good if the comment was
accurate.
2008-03-25 Jakub Jelinek <jakub@redhat.com>
* posix/gai.conf: Fix comment for scope nullbits.
* sysdeps/posix/getaddrinfo.c (gaiconf_init): If /bits is not present,
default to 128 bits for v4 mapped addresses.
--- libc/posix/gai.conf.jj 2007-12-10 09:05:34.000000000 +0100
+++ libc/posix/gai.conf 2008-03-25 16:57:53.000000000 +0100
@@ -65,4 +65,4 @@
#scopev4 ::ffff:10.0.0.0/104 5
#scopev4 ::ffff:172.16.0.0/108 5
#scopev4 ::ffff:192.168.0.0/112 5
-#scopev4 ::ffff:0.0.0.0 14
+#scopev4 ::ffff:0.0.0.0/96 14
--- libc/sysdeps/posix/getaddrinfo.c.jj 2008-02-01 10:54:30.000000000 +0100
+++ libc/sysdeps/posix/getaddrinfo.c 2008-03-25 16:57:01.000000000 +0100
@@ -1775,6 +1775,7 @@ gaiconf_init (void)
*cp++ = '\0';
if (inet_pton (AF_INET6, val1, &prefix))
{
+ bits = 128;
if (IN6_IS_ADDR_V4MAPPED (&prefix)
&& (cp == NULL
|| (bits = strtoul (cp, &endp, 10)) != ULONG_MAX
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-03-25 16:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-25 16:08 [PATCH] scopev4 in /etc/gai.conf Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).