Bug 453325 - RFE: export useful resolver interfaces
RFE: export useful resolver interfaces
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-29 14:05 EDT by Jeff Garzik
Modified: 2016-11-24 10:47 EST (History)
3 users (show)

See Also:
Fixed In Version: 2.8.90-11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-08-02 23:02:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Example code used in server to look up DNS SRV records (4.87 KB, text/plain)
2008-07-09 14:36 EDT, Jeff Garzik
no flags Details
BIND DNS zone used for testing (245 bytes, text/plain)
2008-07-09 14:37 EDT, Jeff Garzik
no flags Details

  None (edit)
Description Jeff Garzik 2008-06-29 14:05:25 EDT
Description of problem:
ns_initparse(), ns_parserr() and friends have been in O'Reilly books and in
glibc for many years.

These functions make querying DNS (SRV records, in my case) very easy. 
Currently, I am forced to link directly with /usr/lib64/libresolv.a in
glibc-devel package, because the functions are not exported.

Request:  export these as fully supported interfaces.  They are highly useful,
already in glibc, publicly documented books for many years, and mentioned in
/usr/include/arpa/nameser.h.


Version-Release number of selected component (if applicable):
glibc-devel-2.8-3.x86_64

How reproducible:
always

Steps to Reproduce:
1. write application with ns_initparse()
2. attempt to link with "-lresolv", watch it fail
3. attempt to link with /usr/lib64/libresolv.a, watch it succeed
  
Actual results:
Link failure for functions in arpa/nameser.h. 

Expected results:
Success using functions in arpa/nameser.h.

Additional info:
My key need is querying SRV records.
Comment 1 Ulrich Drepper 2008-07-09 14:00:49 EDT
Provide (a pointer to) a complete example using those interfaces.
Comment 2 Jeff Garzik 2008-07-09 14:36:28 EDT
Created attachment 311401 [details]
Example code used in server to look up DNS SRV records

Here is the requested example code, which has been tested in its original form
as found in open source coarse lock daemon:
git://git.kernel.org/pub/scm/daemon/cld/cld.git

The attachment has been massaged slightly to compile on its own.  Linking
requires directly referencing /usr/lib[64]/libresolv.a as mentioned.
Comment 3 Jeff Garzik 2008-07-09 14:37:42 EDT
Created attachment 311402 [details]
BIND DNS zone used for testing

This is a BIND zone file used with bind-9.5.0-32.rc1.fc9.x86_64 to test
successful queries of DNS SRV records.	It includes a single example which
returns 3 SRV records in response.
Comment 4 Jeff Garzik 2008-07-09 14:39:55 EDT
Let me know if you need any more info.

The alternative to this API is hand-decoding DNS RRs, which is a royal pain. 
You still must know the RFC-specified layout of each RR being decoded, but the
ns* API makes client code more readable, and more maintainable.
Comment 5 Ulrich Drepper 2008-08-01 13:19:13 EDT
Upstream has now most of the functions declared in <arpa/nameser.h>.  Please
test it when Jakub builds the next rawhide glibc.
Comment 6 Ulrich Drepper 2008-08-02 23:02:22 EDT
Now in rawhide.

Note You need to log in before you can comment on or make changes to this bug.