getaddrinfo fails with numerical IPv6 values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GLibC |
Fix Released
|
Unknown
|
|||
Linux Mint |
Invalid
|
Undecided
|
Unassigned | ||
glibc (Ubuntu) |
New
|
Undecided
|
Unassigned |
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=
int main(int argc, char * argv[])
{
int ret=0;
struct addrinfo *ai = NULL;
ret = getaddrinfo(
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://
100 /var/lib/
Related branches
Changed in glibc: | |
status: | Unknown → New |
tags: | added: ipv6 |
Changed in glibc: | |
status: | New → Fix Released |
Changed in linuxmint: | |
status: | New → Invalid |
I just noticed this discussion: http:// bugs.debian. org/cgi- bin/bugreport. cgi?bug= 435646 which is most likely related to what I am seeing (I have no global IPv6 on my test machine). So maybe this is not a bug but a feature... hum...