Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 265963 Details for
Bug 282081
sys-libs/glibc (?) getaddrinfo() doesn't return addresses RFC-3484 compliant when using NULL as node
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
gai_bug.c
gai_bug.c (text/plain), 824 bytes, created by
Hans Nieser
on 2011-03-15 13:41:23 UTC
(
hide
)
Description:
gai_bug.c
Filename:
MIME Type:
Creator:
Hans Nieser
Created:
2011-03-15 13:41:23 UTC
Size:
824 bytes
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <netdb.h> >#include <sys/types.h> >#include <sys/socket.h> > >int main(int argc, char **argv) >{ > struct addrinfo hints, *result, *ai; > > memset(&hints, 0, sizeof(struct addrinfo)); > > hints.ai_socktype = SOCK_STREAM; > hints.ai_flags |= AI_PASSIVE; > hints.ai_flags |= AI_ADDRCONFIG; > > if (getaddrinfo(NULL, argv[1], &hints, &result)) > { > printf("failed to get addresses\n"); > exit(EXIT_FAILURE); > } > > for (ai = result; ai != NULL; ai = ai->ai_next) > { > if (ai->ai_family == AF_INET) > printf("this is an IPv4 result\n"); > else if(ai->ai_family == AF_INET6) > printf("this is an IPv6 result\n"); > else > printf("eww what's this?\n"); > } > > freeaddrinfo(result); >}
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 282081
: 265963