On 9/28/06, Jonathan Oksman <[EMAIL PROTECTED]> wrote:

This is my first actual post here, but I've been reading for quite
some time.  I've been using LFS since book 3 for some kind of
relativity (not that it should indicate anything, really).

Thanks for reporting the problem. It would also be nice if you could
create a ticket so we don't forget this. This happens on the BLFS
wiki, and you'd need an account to create a ticket.

http://wiki.linuxfromscratch.org/blfs/

The problem only occurs when dhclient attempts to resolve from a
server that does not supply a domain-name.  Debugging lead me to
realize that it comes down to this specific line from dhclient-script
(which is unmodified from the iproute2 patch, all versions):

if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then

If a domain-name is not passed from the router, then this line causes
the resolv.conf update function to fail, even if it recieved
domain-name-servers in the $new_domain_name_servers variable.  Due to
the design of the whole function, it needs to be reworked as such to
avoid any glitches.

if [ "x$new_domain_name" != x ] || [ x"$new_domain_name_servers" != x ]; then
    echo "# this file was generated by dhclient-script (even if you
don't have a domain-name)." > /etc/resolv.conf
    chmod 755 /etc/resolv.conf
fi
if [ "x$new_domain_name" != x ]; then
    echo "search $new_domain_name" >> /etc/resolv.conf
fi
if [ "x$new_domain_name_servers" != x ]; then
    for nameserver in $new_domain_name_servers; do
        echo "nameserver $new_domain_name_servers" >> /etc/resolv.conf
    done
fi

Yeah, the dhclient script is pretty crappy. I think you did the same
thing that Jürg Billeter was doing on Paldo. Here's a copy of that
patch:

http://www.linuxfromscratch.org/~dnicholson/dhcp-3.0.3-dns-1.patch

Does that do the same thing?

I don't know if there was a reason that the script was excluding dns
for nameless domain routers.  Then again, I don't know why the script
uses "x" instead of the -n flag to check for not null.  If nobody can
think of a good reason why this shouldn't be like this I will gladly
submit a patch after I learn how to make one.

It's old and crusty? Fedora uses about 10 patches on it. The "x" is
used because it's more portable for /bin/sh. The same thing happens in
configure scripts.

The last time I stopped using the dhcp client was because the "hooks"
execution didn't work correctly.

Also, it should be noted that this can be worked around without a
patch - if you set a supersede statement in your dhclient.conf then
everything will work fine whether your router is glitchy or not.  This
modification just allows resolv.conf to actually be updated if for
some reason the domain name is null.

I think it's better that we use a patch, personally. Feel free to whip
one up and put it in a ticket. That would be great.

--
Dan
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to