public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/296] New: POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo()
@ 2004-08-01 22:20 a dot guru at sympatico dot ca
  2004-08-01 22:23 ` [Bug libc/296] " a dot guru at sympatico dot ca
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: a dot guru at sympatico dot ca @ 2004-08-01 22:20 UTC (permalink / raw)
  To: glibc-bugs

This is for [glibc-2.3.3-200407231111],
files sysdeps/posix/getaddrinfo.c
  and resolv/netdb.h.

This refers to IEEE 1003.1, 2004 Edition, "Information technology --
Portable Operating System Interface (POSIX) --
Part 2: System Interfaces", getaddrinfo().

First:

] If the AI_NUMERICHOST flag is specified, then a non-null nodename
] string supplied shall be a numeric host address string. Otherwise,
] an [EAI_NONAME] error is returned. This flag shall prevent any
] type of name resolution service (for example, the DNS) from being
] invoked.

Then:

] If the specified address family is AF_INET or AF_UNSPEC, address
] strings using Internet standard dot notation as specified in
] inet_addr() are valid.

and

] If the specified address family is AF_INET6 or AF_UNSPEC,
] standard IPv6 text forms described in inet_ntop() are valid.

This means that both inet_addr() and inet_ntop() are valid if the
specified address family is AF_UNSPEC.

Not conforming to this can negatively impact backward
compatibility in applications that have been upgraded
from using inet_addr() to using getaddrinfo().

See <http://www.opengroup.org/onlinepubs/009695399/functions/getaddrinfo.html>
and <http://www.opengroup.org/onlinepubs/009695399/basedefs/netdb.h.html>.

A proposed patch follows.  I wrote it and I am putting it in the public
domain.

-- 
           Summary: POSIX => AI_NUMERICHOST and address notation validity in
                    getaddrinfo()
           Product: glibc
           Version: 2.3.3
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: a dot guru at sympatico dot ca
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: n/a
  GCC host triplet: n/a
GCC target triplet: n/a


http://sources.redhat.com/bugzilla/show_bug.cgi?id=296

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/296] POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo()
  2004-08-01 22:20 [Bug libc/296] New: POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo() a dot guru at sympatico dot ca
@ 2004-08-01 22:23 ` a dot guru at sympatico dot ca
  2004-08-05  0:01 ` jakub at redhat dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: a dot guru at sympatico dot ca @ 2004-08-01 22:23 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From a dot guru at sympatico dot ca  2004-08-01 22:23 -------
Created an attachment (id=149)
 --> (http://sources.redhat.com/bugzilla/attachment.cgi?id=149&action=view)
patch for POSIX AI_NUMERICHOST support and address notation validity in
getaddrinfo()


-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=296

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/296] POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo()
  2004-08-01 22:20 [Bug libc/296] New: POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo() a dot guru at sympatico dot ca
  2004-08-01 22:23 ` [Bug libc/296] " a dot guru at sympatico dot ca
@ 2004-08-05  0:01 ` jakub at redhat dot com
  2004-08-05 16:11 ` jakub at redhat dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at redhat dot com @ 2004-08-05  0:01 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2004-08-05 00:01 -------
The patch looks good to me (except formatting and missing ChangeLog entry).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |drepper at redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=296

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/296] POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo()
  2004-08-01 22:20 [Bug libc/296] New: POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo() a dot guru at sympatico dot ca
  2004-08-01 22:23 ` [Bug libc/296] " a dot guru at sympatico dot ca
  2004-08-05  0:01 ` jakub at redhat dot com
@ 2004-08-05 16:11 ` jakub at redhat dot com
  2004-08-05 18:01 ` jakub at redhat dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at redhat dot com @ 2004-08-05 16:11 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2004-08-05 16:11 -------
*** Bug 298 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dlstevens at us dot ibm dot
                   |                            |com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=296

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/296] POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo()
  2004-08-01 22:20 [Bug libc/296] New: POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo() a dot guru at sympatico dot ca
                   ` (2 preceding siblings ...)
  2004-08-05 16:11 ` jakub at redhat dot com
@ 2004-08-05 18:01 ` jakub at redhat dot com
  2004-08-05 20:10 ` a dot guru at sympatico dot ca
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at redhat dot com @ 2004-08-05 18:01 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2004-08-05 16:10 -------
2004-08-05  Ulrich Drepper  <drepper@redhat.com>

        * sysdeps/posix/getaddrinfo.c (gaih_inet): Recognize all the IPv4
        numeric address formats inet_addr knows.
        (getaddrinfo): Allow AI_NUMERICSERV flag.
        If neither IPv4 nor IPv6 inerface is present we cannot make any
        decision for AI_ADDRCONFIG.  Fail if AI_NUMERICSERV is set and the
        string is not just a number.  Remove useless freeaddrinfo call.
        * resolv/netdb.h (AI_NUMERICSERV): Define.
        Based on a patch by a.guru@sympatico.ca.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sources.redhat.com/bugzilla/show_bug.cgi?id=296

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/296] POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo()
  2004-08-01 22:20 [Bug libc/296] New: POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo() a dot guru at sympatico dot ca
                   ` (3 preceding siblings ...)
  2004-08-05 18:01 ` jakub at redhat dot com
@ 2004-08-05 20:10 ` a dot guru at sympatico dot ca
  2004-08-05 20:19 ` drepper at redhat dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: a dot guru at sympatico dot ca @ 2004-08-05 20:10 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From a dot guru at sympatico dot ca  2004-08-05 20:10 -------
The new logic on line 578 of getaddrinfo.c

      if (__inet_aton (name, (struct in_addr *) at->addr) != 0)

is incorrect.  Only the form recognized by inet_pton() should be valid
when req->ai_family == AF_INET6 according to the standard.  This is no
longer the case now.  The logic in the patch I submitted is correct and
I believe it is not possible to reduce it to a liter form and still
remain correct.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://sources.redhat.com/bugzilla/show_bug.cgi?id=296

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/296] POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo()
  2004-08-01 22:20 [Bug libc/296] New: POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo() a dot guru at sympatico dot ca
                   ` (4 preceding siblings ...)
  2004-08-05 20:10 ` a dot guru at sympatico dot ca
@ 2004-08-05 20:19 ` drepper at redhat dot com
  2004-08-05 20:24 ` a dot guru at sympatico dot ca
  2004-08-05 21:50 ` drepper at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: drepper at redhat dot com @ 2004-08-05 20:19 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2004-08-05 20:19 -------
No.  The AF_INET6 case is only talking about the IPv6 addresses.  Not the format
for addresses mapped from IPv4 to IPv6.  The standard does not really describe
the format of IPv4 addresses if AF_INET6 with AI_V4MAPPED is used.  To make it
consistent, the use of inet_aton is best.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


http://sources.redhat.com/bugzilla/show_bug.cgi?id=296

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/296] POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo()
  2004-08-01 22:20 [Bug libc/296] New: POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo() a dot guru at sympatico dot ca
                   ` (5 preceding siblings ...)
  2004-08-05 20:19 ` drepper at redhat dot com
@ 2004-08-05 20:24 ` a dot guru at sympatico dot ca
  2004-08-05 21:50 ` drepper at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: a dot guru at sympatico dot ca @ 2004-08-05 20:24 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From a dot guru at sympatico dot ca  2004-08-05 20:24 -------
I notice the new line 588 in getaddrinfo.c

               at->family = AF_INET6;

This is right and I think a similar line should be added after line 608

                 *(uint32_t *) at->addr = ((uint32_t *) at->addr)[3];

in the "opposite" case

                 at->family = AF_INET;

with new braces of course.


-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=296

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libc/296] POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo()
  2004-08-01 22:20 [Bug libc/296] New: POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo() a dot guru at sympatico dot ca
                   ` (6 preceding siblings ...)
  2004-08-05 20:24 ` a dot guru at sympatico dot ca
@ 2004-08-05 21:50 ` drepper at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: drepper at redhat dot com @ 2004-08-05 21:50 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2004-08-05 21:50 -------
Correct.  Although one more if condition is missing since we should not assume
there is no third or fourth protocol.

-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=296

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-08-05 21:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-01 22:20 [Bug libc/296] New: POSIX => AI_NUMERICHOST and address notation validity in getaddrinfo() a dot guru at sympatico dot ca
2004-08-01 22:23 ` [Bug libc/296] " a dot guru at sympatico dot ca
2004-08-05  0:01 ` jakub at redhat dot com
2004-08-05 16:11 ` jakub at redhat dot com
2004-08-05 18:01 ` jakub at redhat dot com
2004-08-05 20:10 ` a dot guru at sympatico dot ca
2004-08-05 20:19 ` drepper at redhat dot com
2004-08-05 20:24 ` a dot guru at sympatico dot ca
2004-08-05 21:50 ` drepper at redhat dot com

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).