Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 54183 Details for
Bug 86313
Erroneous address ordering from glibc getaddrinfo()
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Simple program to test getaddrinfo()
addrtest.c (text/plain), 988 bytes, created by
Fredrik Tolf
on 2005-03-22 14:45:19 UTC
(
hide
)
Description:
Simple program to test getaddrinfo()
Filename:
MIME Type:
Creator:
Fredrik Tolf
Created:
2005-03-22 14:45:19 UTC
Size:
988 bytes
patch
obsolete
>#include <string.h> >#include <stdio.h> >#include <sys/socket.h> >#include <netdb.h> >#include <assert.h> > >int main(int argc, char **argv) >{ > int i; > struct addrinfo *res, *c; > struct addrinfo hint; > char *node, *serv; > int ret; > > memset(&hint, 0, sizeof(hint)); > hint.ai_flags = AI_CANONNAME; > node = serv = NULL; > if(argc > 1) > node = argv[1]; > if(argc > 2) > serv = argv[2]; > if(ret = getaddrinfo(node, serv, &hint, &res)) > { > fputs(gai_strerror(ret), stderr); > fputc('\n', stderr); > return(1); > } > for(c = res; c != NULL; c = c->ai_next) > { > printf("%x %i %i %i %s\n", c->ai_flags, c->ai_family, c->ai_socktype, c->ai_protocol, c->ai_canonname); > for(i = 0; i < c->ai_addrlen; i++) > { > printf("%02x ", (int)(((unsigned char *)c->ai_addr)[i])); > if(i & 0xf == 0) > printf("\n"); > } > printf("\n\n"); > } > freeaddrinfo(res); > return(0); >} > >/* > * Local Variables: > * compile-command: "gcc -g -o addrtest addrtest.c" > * End: > */
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 86313
:
54182
| 54183