Ticket #421 (closed defect: fixed)
bitlbee is not doing SRV lookups on FreeBSD
| Reported by: | wah.java@… | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | BitlBee | Version: | 1.2 |
| Keywords: | freebsd, srv, lookup, resolver | Cc: | |
| IRC client+version: | Client-independent | Operating System: | FreeBSD |
| OS version/distro: | 7.0-RELEASE-p1 |
Description
bitlbee is not performing SRV lookups on FreeBSD. It expects libresolv.a to be present for resolver routines. On FreeBSD resolver routines are available in libc, so there is no libresolv.a .
Attachments
Change History
Changed 4 years ago by wah.java@…
-
attachment
patch-configure
added
comment:1 follow-up: ↓ 2 Changed 4 years ago by Wilmer van der Gaast <wilmer@…>
On FreeBSD resolver routines are available in libc, so there is no libresolv.a .
Are you sure that FreeBSD's libc has a full set of libresolv functions?
Including ns_initparse()? At least glibc is retarded enough to only
export them in libresolv.a.
comment:2 in reply to: ↑ 1 Changed 4 years ago by wah.java@…
Replying to Wilmer van der Gaast <wilmer@gaast.net>:
On FreeBSD resolver routines are available in libc, so there is no libresolv.a .
Are you sure that FreeBSD's libc has a full set of libresolv functions?
Including ns_initparse()? At least glibc is retarded enough to only
export them in libresolv.a.
Check out res_query(3). Though, there is no mention of ns_initparse() in their manpages, but I found this:
abbe [~] chateau% strings /lib/libc.so.7|fgrep ns_init __ns_initparse do_query: ns_initparse failed ;; ns_initparse: %s
And BtW, this patch works for me flawlessly :) .
comment:3 Changed 4 years ago by Wilmer van der Gaast <wilmer@…>
res_query(3)]. Though, there is no mention of ns_initparse() in their
manpages, but I found this:
{{{
abbe [~] chateau% strings /lib/libc.so.7|fgrep ns_init
ns_initparse
Hrmm, yeah, that's the important one. glibc doesn't have it. Not that
the string ns_initparse doesn't appear in libc.so, but only in strings. :-/
And BtW, this patch works for me flawlessly :) .
Cool. Not sure if I should take the patch like this, it's probably time
to go the autoconf way and just try to compile and run a binary in a few
ways. :-(
comment:4 Changed 4 years ago by wilmer
- Status changed from new to closed
- Resolution set to duplicate
Let's keep one bug for all libresolv-related problems: #390.
comment:5 Changed 18 months ago by ashish@…
- Status changed from closed to reopened
- Resolution duplicate deleted
I updated the patch for BitlBee 3.0. It works fine for me.
Attaching it. Let me know if you've any questions.
Ashish
Changed 18 months ago by ashish@…
-
attachment
patch-configure.2
added
diff to enable SRV record lookup support for FreeBSD
comment:6 follow-up: ↓ 7 Changed 5 months ago by brynet@…
OpenBSD also has the res_* functions in libc, Ashish's patch doesn't handle other BSD's and it doesn't modify lib/misc.c to add the needed headers. I'm not sure about FreeBSD. Just curious but does HAVE_RESOLV_A get added to your config.h Ashish?
OpenBSD doesn't have the ns_* functions unfortunately, but I came across this while debugging another problem with bitlbee on OpenBSD.. I didn't notice SRV lookups didn't work.
It should be safe to include both headers on most platforms, several important types and functions declared there.
-Bryan.
comment:7 in reply to: ↑ 6 Changed 5 months ago by ashish@…
Replying to brynet@…:
OpenBSD also has the res_* functions in libc, Ashish's patch doesn't handle other BSD's and it doesn't modify lib/misc.c to add the needed headers. I'm not sure about FreeBSD. Just curious but does HAVE_RESOLV_A get added to your config.h Ashish?
OpenBSD doesn't have the ns_* functions unfortunately, but I came across this while debugging another problem with bitlbee on OpenBSD.. I didn't notice SRV lookups didn't work.
It should be safe to include both headers on most platforms, several important types and functions declared there.
-Bryan.
Hi Bryan,
Yes, I get HAVE_RESOLV_A added to my config.h after running configure with that diff applied. This diff is also present in irc/bitlbee/patch-configure in FreeBSD ports repository.
HTH Ashish
comment:8 follow-up: ↓ 9 Changed 5 months ago by wilmer
Ah, I completely lost track of this patch! I submitted it with some changes as changeset:devel,839. brynet, I'm trying to figure out what you mean here ... looks like OpenBSD's libresolv doesn't have all the required functions to perform these lookups?
comment:9 in reply to: ↑ 8 Changed 5 months ago by brynet@…
Replying to wilmer:
Ah, I completely lost track of this patch! I submitted it with some changes as changeset:devel,839. brynet, I'm trying to figure out what you mean here ... looks like OpenBSD's libresolv doesn't have all the required functions to perform these lookups?
OpenBSD doesn't have libresolv, according to the history section BSD has had the res_* API's since 4.3 BSD as part of libc, BIND first made it's debut on BSD and I believe that's where it inherited the functions (..libc resolver code hasn't been kept in sync with BIND).
The ns_* API functions are not part of OpenBSD's libc, they're not available at all as far as I can tell.
comment:10 Changed 5 months ago by wilmer
- Status changed from reopened to closed
- Resolution set to fixed
Sigh, that sucks. Maybe some day when I add support for an async DNS library we'll get that fixed. Until then I guess you'll just have to set the servername by hand.
This bug is just about FreeBSD though, so time to mark it as fixed. Thanks Ashish!

diff to patch the configure script