[En-Nut-Discussion] DHCP Failure on Renew

Ulrich Prinz uprinz2 at netscape.net
Fri Oct 30 00:53:36 CET 2009


Hi!

Hm, I am actually working in that direction...
My Problem with DHCP was, that it did not work if you change the network 
completely, i.e. unplug the system at home with 192.168.3.0/24 and plug 
it in at work with 10.201.32.0/16.

In my opinion there are several problems buriedin DHCP, but let's stick 
to the one you saw...

I found this in line 1773:
         else if (dhcpState == DHCPST_REBINDING) {
             retries++;
             if (tmo > dhcpConfig->dyn_rebindTime - (NutGetSeconds() - 
leaseTime)) {
                 tmo = dhcpConfig->dyn_rebindTime - NutGetSeconds() - 
leaseTime;
             }
             if (dhcpConfig->dyn_rebindTime <= NutGetSeconds() - 
leaseTime) {
                 retries = 0;
                 dhcpState = DHCPST_REBINDING;
             }
             /* Broadcast a request for our previous configuration. We
                must not include a server identifier. */
             else if (DhcpBroadcastRequest(sock, bp, xid, 
dhcpConfig->dyn_yiaddr, dhcpConfig->dyn_yiaddr, 0, secs) < 0) {


This looks a bit like if the DHCPST_REBINDING is timed out, it stays in 
DHCPST_REBINDING in the second if()...
Looks like someone tried to escape this situation by checking for 
retries, but the if( retries > n) 'out of here' is missing.
On the other hand, there is a timeout and if that is over one needs to 
get out of that loop instead of staying inside.

How did you find out about that problem? Is there a backup DHCP in your 
network and the primary failed? Or did you simply leave the box in you 
network that long, that the lease expired? I think I remember, that the 
EIR did not work after lying around a longer time playing musik. I 
simply reset it and it worked again for days. But I never tried to find 
out why and I don't know the lease-time the Fritbox assigns to it's 
clients.

I'll try that DHCP lease timeout in the next few days. Never checked 
that, as my problems were at another situation.

By the way, I modified the DM9000 driver for the EIR and now I can 
switch networks with different subnets and subnet-sizes and I get a dhcp 
lease... Yes, ouch. Never expected the problem to be that far down in 
the OSI model :)

Regards
Ulrich

Michael Jones schrieb:
> Hello,
> 
> We have been having problems with DHCP enabled client dying after half lease
> time for quite a while (Also reported by Ulrich a few days ago).
> 
> My observations are that the DHCP thread gets stuck in the DHCPST_REBINDING
> state and never sends the request nor yields to any other thread.
> 
> I'm still trying to understand to whole state machine, but perhaps somebody
> could look at the "else" in dhcpc.c (trunk), line 1714 - IMHO that "else"
> should not be there. Also, I'm not quite sure how the DHCPST_REBINDING state
> should conclude once it has been entered.
> 
> cu,
> Michael
> 
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion



More information about the En-Nut-Discussion mailing list