[Bug 239701] Re: getaddrinfo fails with numerical IPv6 values

chemicalfan 239701 at bugs.launchpad.net
Tue Apr 28 12:47:54 UTC 2015


** Changed in: linuxmint
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/239701

Title:
  getaddrinfo fails with numerical IPv6 values

Status in The GNU C Library:
  Fix Released
Status in The Linux Mint Distribution:
  Invalid
Status in glibc package in Ubuntu:
  New

Bug description:
  Binary package hint: libc6

  The function "getaddrinfo" returns an error when it receives a
  numerical IPv6 value as hostname.

  The following sample demonstrates the bug:
  $ cat > bug.c <<EOF
  #include <stdio.h>
  #include <sys/socket.h>
  #include <netdb.h>
  const char * candidate="2001:db8::1";
  int main(int argc, char * argv[])
  {
  	int ret=0;
  	struct addrinfo *ai = NULL;
  	ret = getaddrinfo(candidate, NULL, NULL, &ai);
  	if (ai)  freeaddrinfo(ai);
  	if (ret != 0) printf("Error on '%s': %s.\n", candidate, gai_strerror(ret));
  	return 0;
  }
  EOF
  $ gcc -o bug bug.c
  $ ./bug
  Error on '2001:db8::1': Address family for hostname not supported.

  I have tested the same code on a Debian Etch and the bug does not
  appear.

  I am running a Ubuntu Hardy with latest updates. My libc6 package is
  2.7-10ubuntu3.

  $ lsb_release -rd
  Description:	Ubuntu 8.04
  Release:	8.04

  $ apt-cache policy libc6
  libc6:
    Installed: 2.7-10ubuntu3
    Candidate: 2.7-10ubuntu3
    Version table:
   *** 2.7-10ubuntu3 0
          500 http://ubuntutym.u-toyama.ac.jp hardy/main Packages
          100 /var/lib/dpkg/status

To manage notifications about this bug go to:
https://bugs.launchpad.net/glibc/+bug/239701/+subscriptions



More information about the foundations-bugs mailing list