Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Feb 2003 12:22:46 -0800
From:      "Crist J. Clark" <crist.clark@attbi.com>
To:        Raymond Wiker <Raymond.Wiker@fast.no>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: dhclient problem in stable
Message-ID:  <20030224202246.GA39984@blossom.cjclark.org>
In-Reply-To: <15961.2003.461479.956760@raw.grenland.fast.no>
References:  <15961.2003.461479.956760@raw.grenland.fast.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 23, 2003 at 06:41:39PM +0100, Raymond Wiker wrote:
>         This problem has actually existed for a while, but I never got
> round to reporting it.
> 
>         I'm using a Cisco 770 ISDN router to connect to my employer's
> network. This router is set up with DHCP, so I can connect my various
> machines to the router, tell them to get their network config from
> DHCP, and all is dandy.
> 
>         Well, no quite. It seems the router is set up to return 2^32 -
> 1 as the lease time, which the dhclient code interprets as -1. This
> crashes at line 792 in /usr/src/contrib/isc-dhcp/client/dhclient.c,
> at an expression that involves the modulo (%) operator. The reason for
> the crash is that the rhs of the modulo operation is zero.

Strange that this has never come up before. A time value of 0xffffffff
means "infinity" in DHCP. There should be special handling of this
case by the client, but I don't see it.

>         I can "fix" this by changing the code at line 787 (see patch
> below). I'm not sure that this is the right solution, though: it may
> be appropriate to make client->new->renewal an unsigned int instead of
> a signed one. It is also possible that the config of the Cisco router
> is out of spec :-)

The fix is not strictly correct, IMHO. Infinity should really be
infinity. From your report and a very cursory look at the code, it
doesn't look like dhclient(8) handles infinite leases properly or at
all.
-- 
Crist J. Clark                     |     cjclark@alum.mit.edu
                                   |     cjclark@jhu.edu
http://people.freebsd.org/~cjc/    |     cjc@freebsd.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030224202246.GA39984>