Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 585779 Details for
Bug 821847
Using /net to access a NFS share leads to a segfault
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Test getaddrinfo(3) lookup program
gai-test.c (text/plain), 1.71 KB, created by
Ian Kent
on 2012-05-21 10:57:47 UTC
(
hide
)
Description:
Test getaddrinfo(3) lookup program
Filename:
MIME Type:
Creator:
Ian Kent
Created:
2012-05-21 10:57:47 UTC
Size:
1.71 KB
patch
obsolete
>/* > * gcc -g -o gai-leak gai-leak.c > * valgrind --num-callers=12 --leak-check=full ./gai-leak > */ >#include <stdio.h> >#include <string.h> >#include <stdlib.h> >#include <netdb.h> > >int main(int argc, char **argv) >{ > struct addrinfo *ai, *haddr; > struct addrinfo hints; > char *host; > int ret; > > if (argc < 2) { > printf("invalid number of arguments\n"); > exit (1); > } > > host = argv[1]; > > memset(&hints, 0, sizeof(hints)); > hints.ai_flags = AI_ADDRCONFIG; > hints.ai_family = AF_UNSPEC; > hints.ai_socktype = SOCK_DGRAM; > > ret = getaddrinfo(host, NULL, &hints, &ai); > if (ret) { > printf("sock_dgram query lookup error: %s\n", gai_strerror(ret)); > goto stream; > } > > if (!ai) { > printf("sock_dgram query addrinfo is NULL without error return\n"); > goto stream; > } > > haddr = ai; > while (haddr) { > printf("sock_dgram query addrinfo %p\n", haddr); > if (ai->ai_canonname) > printf("sock_dgram query ai_canonname: %s\n", ai->ai_canonname); > if (ai->ai_addr) > printf("sock_dgram query ai_addr is non-null\n"); > haddr = haddr->ai_next; > } > > freeaddrinfo(ai); >stream: > memset(&hints, 0, sizeof(hints)); > hints.ai_flags = AI_ADDRCONFIG; > hints.ai_family = AF_UNSPEC; > hints.ai_socktype = SOCK_STREAM; > > ret = getaddrinfo(host, NULL, &hints, &ai); > if (ret) { > printf("sock_stream query lookup error: %s\n", gai_strerror(ret)); > exit(1); > } > > if (!ai) { > printf("sock_stream query addrinfo is NULL without error return\n"); > exit(1); > } > > haddr = ai; > while (haddr) { > printf("sock_stream query addrinfo %p\n", haddr); > if (ai->ai_canonname) > printf("sock_stream query ai_canonname: %s\n", ai->ai_canonname); > if (ai->ai_addr) > printf("sock_stream query ai_addr is non-null\n"); > haddr = haddr->ai_next; > } > > freeaddrinfo(ai); > > exit(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 821847
: 585779 |
585787
|
585984
|
585985