Sourceware Bugzilla – Attachment 9933 Details for
Bug 21295
GETAI(AF_UNSPEC) drops IPv6 addresses if nss module does not support gethostbyname4_r
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Here is how to reproduce the issue in docker.
docker.txt (text/plain), 2.28 KB, created by
Dmitry Bilunov
on 2017-03-23 13:22:27 UTC
(
hide
)
Description:
Here is how to reproduce the issue in docker.
Filename:
MIME Type:
Creator:
Dmitry Bilunov
Created:
2017-03-23 13:22:27 UTC
Size:
2.28 KB
patch
obsolete
> >> docker run --rm -it ubuntu:12.04 bash >root@63fe1bb724ae:/# ( apt-get update && apt-get install -y build-essential ) &> /dev/null >root@63fe1bb724ae:/# cat > test.c <<EOF >> #include <arpa/inet.h> >> #include <netdb.h> >> #include <stdio.h> >> #include <stdlib.h> >> #include <string.h> >> >> int main() { >> struct addrinfo *result; >> struct addrinfo *res; >> int error; >> char *host = "ya.ru"; >> char buf[512]; >> >> /* resolve the domain name into a list of addresses */ >> error = getaddrinfo(host, NULL, NULL, &result); >> if (error != 0) { >> if (error == EAI_SYSTEM) { >> perror("getaddrinfo"); >> } else { >> fprintf(stderr, "error in getaddrinfo: %s\n", gai_strerror(error)); >> } >> exit(EXIT_FAILURE); >> } >> >> for (res = result; res != NULL; res = res->ai_next) { >> if (res->ai_family == AF_INET) >> inet_ntop(res->ai_family, &((struct sockaddr_in *)res->ai_addr)->sin_addr, buf, sizeof(buf)); >> else if (res->ai_family == AF_INET6) >> inet_ntop(res->ai_family, &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr, buf, sizeof(buf)); >> else >> continue; >> puts(buf); >> } >> >> freeaddrinfo(result); >> return 0; >> } >> EOF >root@63fe1bb724ae:/# gcc test.c -o test >root@63fe1bb724ae:/# ./test | uniq >213.180.193.3 >93.158.134.3 >213.180.204.3 >root@63fe1bb724ae:/# dpkg -l libc6 >Desired=Unknown/Install/Remove/Purge/Hold >| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend >|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) >||/ Name Version Description >+++-=====================================================-=====================================================-========================================================================================================================== >ii libc6 2.15-0ubuntu10.17 Embedded GNU C Library: Shared libraries >root@63fe1bb724ae:/# exit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 21295
: 9933