Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 321736 Details for
Bug 432020
<sys-libs/glibc-2.21: /var/db/services.db causes infinite loop in getaddrinfo()
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
getaddrinfo.c example
getaddrinfo.c (text/plain), 1.06 KB, created by
Maxim Kammerer
on 2012-08-20 03:16:10 UTC
(
hide
)
Description:
getaddrinfo.c example
Filename:
MIME Type:
Creator:
Maxim Kammerer
Created:
2012-08-20 03:16:10 UTC
Size:
1.06 KB
patch
obsolete
>#include <sys/types.h> >#include <sys/socket.h> >#include <netdb.h> >#include <stdio.h> > >static int xtables_getportbyname(const char *name) >{ > struct addrinfo *res = NULL, *p; > int ret; > > printf("before\n"); > ret = getaddrinfo(NULL, name, NULL, &res); > printf("after\n"); > > if (ret < 0) > return -1; > ret = -1; > for (p = res; p != NULL; p = p->ai_next) { > if (p->ai_family == AF_INET6) { > ret = ((struct sockaddr_in6 *)p->ai_addr)->sin6_port; > break; > } else if (p->ai_family == AF_INET) { > ret = ((struct sockaddr_in *)p->ai_addr)->sin_port; > break; > } > } > freeaddrinfo(res); > if (ret < 0) > return ret; > return ntohs(ret); >} > >int main() { > struct servent *service; > short port = -1; > int port2 = -1; > > if ((service = getservbyname("bootps", NULL)) != NULL) > port = ntohs((unsigned short) service->s_port); > > printf("getservbyname: %d\n", port); > > port2 = xtables_getportbyname("bootps"); > printf("getaddrinfo: %d\n", port2); > > return 0; >}
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 432020
:
321734
| 321736 |
321738