[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#183814: marked as done (libc6: getaddrinfo can't parse all forms of numeric ip addresses)



Your message dated Thu, 6 Apr 2006 21:34:22 +0200
with message-id <20060406193421.GA23862@bode.aurel32.net>
and subject line Bug#183814: libc6: getaddrinfo can't parse all forms of numeric ip addresses
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libc6
Version: 2.3.1-10
Severity: normal

The test program below shows a limitation of the getaddrinfo function, it
doesn't seem to parse numeric ip addresses that aren't formatted using four
separate dotted quads. This is a big regression as traditionally this is how
lots of networks specified their ip addresses. Most standard programs do
support this notation. 

I ran into this problem because rdate now uses getaddrinfo and now breaks when
given "10.1" as an address.

$ ./a.out 10.0.0.1
$ ./a.out 10.0.1
getaddrinfo: Name or service not known
[Exit 1]
$ ./a.out 10.1
getaddrinfo: Name or service not known
[Exit 1]
$ ./a.out $(( 256 * 256 * 256 * 10 + 1 ))
getaddrinfo: Name or service not known
[Exit 1]
$ ping $(( 256 * 256 * 256 * 10 + 1 ))
PING 167772161 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.137 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=0.109 ms

--- 167772161 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.109/0.123/0.137/0.014 ms



#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>

main(int argc, char *argv[])
{
  int retval;
  struct addrinfo *res;
  retval = getaddrinfo(argv[1], "", NULL, &res);
  if (retval) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(retval));
    exit(1);
  }
  exit(0);
}
 



-- System Information
Debian Release: testing/unstable
Kernel Version: Linux stark.dyndns.tv 2.4.19 #6 Tue Sep 10 22:08:51 EDT 2002 i686 unknown unknown GNU/Linux

Versions of the packages libc6 depends on:
ii  libdb1-compat  2.1.3-7        The Berkeley database routines [glibc 2.0/2.


--- End Message ---
--- Begin Message ---
This bug is not present anymore in the latest glibc (2.3.6-5). Closing
it.


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

--- End Message ---

Reply to: