#18333: busybox nslookup and musl
-----------------------------------+------------------------
Reporter: barbaracus@… | Owner: developers
Type: defect | Status: new
Priority: normal | Milestone:
Component: packages | Version: Trunk
Keywords: nslookup busybox musl |
-----------------------------------+------------------------
I found another issue with the musl build in trunk: the nslookup utility
in busybox ignores the optional external server provided through the
command line:
For example:
{{{
nslookup hostname 8.8.8.8
}}}
doesn't use the 8.8.8.8 dns server at all and the resolution is done by
the local resolver.
This issue occurs because the nslookup implementation in busybox fiddles
with the internals of the libc resolver.
It works with uclibc, but doesn't with musl: infact, even though musl
provides those internals, they are non-functional and they are there only
to allow a clean compilation of "broken" programs (quoting from the musl
code res_state.c: "This is completely unused, and exists purely to satisfy
broken apps")
I tried to come up with a simple patch to busybox but I soon realized that
I had to rewrite everything. OTOH the other nslookup utilities available
through the feeds depended on many libraries and I'm very space
constrained in my router.
I wrote therefore a very simple (and possibly not entirely correct)
implementation of nslookup that uses the proper libresolv API to make and
send DNS queries to a local or remote dns server. I tested it with glibc
and musl.
If anybody is interested the code is here: https://github.com/funnydog/ds-
nslookup
Of course a proper fix to busybox would be really welcome.
--
Ticket URL: <https://dev.openwrt.org/ticket/18333>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets