This is the mail archive of the glibc-bugs@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]

[Bug libc/2099] Support for SRV records in getaddrinfo


http://sourceware.org/bugzilla/show_bug.cgi?id=2099

--- Comment #6 from William King <quentusrex at gmail dot com> 2011-01-09 23:10:30 UTC ---
More specifically: 

Given than applications that use getaddrinfo() pass in a host name, (sometimes)
a service name, also struct addrinfo *hints, plus the response struct addrinfo
**res. Usually after checking for an error pass the res structure directly into
the connect() function. The current advantage is that the application does not
have to deal with ipv4 or ipv6 differences(unless it wants to restrict to only
one of the two). 

In the file sysdeps/posix/getaddrinfo.c and a few lines into the function
gaih_inet() right after the protocol and socket type are checked, I propose
adding a check to see "if(service != NULL && (req->ai_flags & GAI_SRV_ENABLE))
{ /* handle SRV lookups */}"

This way if the SRV lookup does return a list of addresses then getaddrinfo()
will return the SRV records, in the order they should be used, but if the SRV
lookup does not return any useful records, then getaddrinfo() will fall back to
the standard lookups below. 

Thoughts?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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