Re: DHCP problems when installing, dhclient "returns status of 2"

Terry Lambert <[email protected]> Sat, 28 Sep 2002 17:06:32 -0700
Newsgroups gmane.os.freebsd.configuration
Message-ID <[email protected]>
David Zeibin wrote:
> I've been googling all over trying to find out what the status of dhclient
> means and coming up with nothing.

[ ... ]

> During DHCP try I get this:
> 
> Notify: Scanning for DHCP servers...
> Executing command 'dhclient -1 fxp0'     //fxp0 -> ethernet device address
> Command 'dhclient -1 fxp0' returns status of 2

Probably, instead of "googling", you should just look at the source
code, where "exit(2)" happens?

/usr/src2/contrib/isc-dhcp/client/dhclient.c:
	[ ... ]
        /* No leases were available, or what was available didn't work, so  
           tell the shell script that we failed to allocate an address,
           and try again later. */
        if (onetry) {
                exit(2);
                note ("Unable to obtain a lease on first try - exiting.\n");
        }

...looks like there's an inverted order here; it probably want
to do the "note()" before the "exit()" (maybe that's just me,
though... 8-)).

This is already fixed, in -current, but you can move the exit(2)
in your local source tree, if you want...

-- Terry

To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-config" in the body of the message