This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libresolv with getaddrinfo


Hi everybody,

I'm trying to use libresolv in conjunction with getaddrinfo to resolve a
hostname with a custom NS server. I got it all worked and documented my
finding here:
http://blog.internot.info/2015/03/specifying-dnsns-server-for-address.html

However, one thing I found, was that on the first usage of
getaddrinfo(), the _res struct is overwritten.

So, in my code, I must do this, before I full in _res.nsaddr_list[0]:

>         getaddrinfo("google.com", NULL, &hints, &servinfo);
>         freeaddrinfo((struct addrinfo*)servinfo);


Is there a specific reason for this?
Is it a bug?


Any hints or info would be highly appreciated.


Thanks,
-- 
-- Joshua Rogers <https://internot.info/>

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]