Roaming, and libresolv being stuck in the 1980's mindset

Siddhesh Poyarekar siddhesh at redhat.com
Mon Apr 20 06:23:20 UTC 2015


On Sat, Apr 18, 2015 at 01:49:57PM -0600, Philip Prindeville wrote:
> If you go back through the previous glibc bugs, you'll find:
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=984
> 
> from 2005 which was closed out as "RESOLVED, WONTFIX" with the text:
> 
>     There is a solution, already implemented.
>     Use nscd and nscd -i hosts in the script that rewrites your resolv.conf
>     (or nsswitch.conf etc.).

Yes, that has been the upstream stance since quite some time now, so I
don't know if filing a fresh bug would change that.  You could however
start a discussion upstream (libc-alpha at sourceware dot org) and
make a case for the resolver to watch for changes in resolv.conf.

> Problem with that is that no one seems to have gravitated towards
> this solution, and I don't blame them. It adds an extra layer of
> complexity and makes debugging issues that much more murky.
> 
> A simpler fix is to grab mtime from stat()ing _PATH_RESCONF each
> time through res_query() and see if it's changed since the last
> time.  Perhaps caching the inode # also and checking that, since an
> older version of the file might have been renamed as
> /etc/resolv.conf.

That is conceptually simple, but expensive, since you'll be adding
syscalls to every lookup.  One may argue that it is not much overhead
for a network lookup since the latter will still take up a bulk of the
time, but it is an added cost nevertheless.

Siddhesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/devel/attachments/20150420/5e2cc0bd/attachment.sig>


More information about the devel mailing list