[uClibc]Tiny resolver bug; multiple A/CNAME useful?

Alex Ibrado code at ibrado.com
Mon Jul 15 16:12:04 UTC 2002


Hi, 

There's a one-off bug decoding uncompressed (non-C0) DNS replies in
0.9.12 and CVS in libc/inet/resolv.c's [__]decode_dotted(). This results
in occasional "host not found" errors for obviously existing hosts.

The fix is to add

    total+=measure; 

right after the loop.

The best test case I've found is www.bestbuy.com, as it seems to give an
uncompressed reply upon a fresh lookup, and its TTL of only 30 seconds
makes retesting easier. Another test case is www.yahoo.com, but it's
more difficult to catch the bug with it.

Also, I've modified resolv.c to return multiple As and CNAMEs. I don't
know whether you guys will just consider this excess baggage for
embedded systems, so let me know if this is useful/interesting and I'll
clean up the new code and send in the diff. Maybe this can be a
non-default option or something. So far I've only done the IPv4 parts in
0.9.12.

A screenshot of busybox nslookup (which I also patched for CNAMEs, etc.)
compiled against 0.9.12 with the said modifications is at

   http://www.ibrado.com/imagebank/nslookup.png

Regards,
Alex 





More information about the uClibc mailing list