bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DHCP support


From: Joachim Nilsson
Subject: Re: DHCP support
Date: Thu, 14 Apr 2005 01:29:43 +0200
User-agent: Debian Thunderbird 1.0 (X11/20050116)

Alfred M. Szmidt wrote:
> Roland McGrath wrote:
> > Marco Gerards wrote:
> > What this patch does is preparing the state of the interfaces so
> > it can use 0.0.0.0 as address and broadcast.
> That has nothing to do with DHCP per se and shouldn't give the
> impression that it does.
Actually, it does.  The patch also sets up the routing table.  Which
is impossible to do without doing some serious hacking in pfinet,
adding a new interface, etc, so that one can use `route'.  And this is
needed for DHCP to work.

I'm inclined to agree with the last speaker. What is it that's so wrong with calling it dhcp? It is, admittedly, a bit of a hack and would only be used by DHCP so better be clear about it than try to obscure it like the below early Linux "hackery". But maybe that's what you'd like better Roland? Giving IP#, mask and broadcast of 0.0.0.0, 0.0.0.0, 255.255.255.255.

Here is a snippet of the dhclient3 PREINIT operation for debian on Linux. It clearly indicates that the $interface is first put into an "open" mode to be able to broadcast and collect an IP#. When one is received a state change to BOUND takes place and the interface is reconfigured as it would have been if it had been a static address.

<dhcp3-3.0.1/client/scripts/debian>
PREINIT)
    # The DHCP client is requesting that an interface be
    # configured as required in order to send packets prior to
    # receiving an actual address. - dhclient-script(8)

    if [ -n "$alias_ip_address" ]; then
        # Bring down alias interface. Its routes will disappear too.
        ifconfig $interface:0- inet 0
    fi
    if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] )
    then
        # Older Linux needs this hackery
        ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
            broadcast 255.255.255.255 up
        route add default dev $interface netmask 0.0.0.0
    else
        # Newer Linux doesn't
        ifconfig $interface 0 up
    fi
    # We need to give the kernel some time to get the interface up.
    sleep 1
    ;;
</dhcp3-3.0.1/client/scripts/debian>

Regards
 /Jocke

--
Joachim Nilsson :: <joachim AT vmlinux DOT org>
+46(0)21-123348 :: <http://vmlinux.org/joachim/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]