[musl] nslookup failures with coarse CLOCK_MONOTONIC

Rich Felker dalias at libc.org
Fri Oct 7 17:05:16 PDT 2022


On Sat, Oct 08, 2022 at 01:53:29AM +0200, Jo-Philipp Wich wrote:
> Hi,
> 
> > [...]
> > Which implementation of nslookup is this? Busybox? It would probably
> > be useful to hear thoughts on it from their side.
> assuming the OP is using standard OpenWrt nslookup, it is the "big" busybox
> nslookup implementation, which is using the res_*() api and name lookup logic
> borrowed from musl libc instead of the original "small" version fiddling with
> the `_res` state directly (and being broken on musl libc due to that).
> 
> The proper course of action here is likely adapting the solution in
> 6c858d6fd4df8b5498ef2cae66c8f3c3eff1587b and porting it to the busybox "big"
> nslookup code itself.
> 
> I agree that musl libc itself cannot do much more to ensure uniqueness of the
> IDs generated by res_mkquery() and that it should be solved in the application
> code itself in this case.

While it won't be as fast (not parallel unless you do threads) it
might be worth just using res_send in the Busybox "big" nslookup. At
present neither busybox nor musl supports TCP fallback for large
records, but the next release of musl will, and the fact that it's
using its own query look with UDP derived from the musl code means it
won't get that benefit.

Alternatively, busybox could copy our parallel TCP fallback code if
they like. :-)

Rich



More information about the openwrt-devel mailing list