From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] scopev4 in /etc/gai.conf
Date: Tue, 25 Mar 2008 16:08:00 -0000 [thread overview]
Message-ID: <20080325161558.GX3726@sunsite.mff.cuni.cz> (raw)
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
reply other threads:[~2008-03-25 16:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080325161558.GX3726@sunsite.mff.cuni.cz \
--to=jakub@redhat.com \
--cc=drepper@redhat.com \
--cc=libc-hacker@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).