From owner-freebsd-stable Mon Feb 24 12:22:52 2003 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E08DA37B401 for ; Mon, 24 Feb 2003 12:22:50 -0800 (PST) Received: from rwcrmhc52.attbi.com (rwcrmhc52.attbi.com [216.148.227.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95E0743FBD for ; Mon, 24 Feb 2003 12:22:49 -0800 (PST) (envelope-from crist.clark@attbi.com) Received: from blossom.cjclark.org (12-234-89-252.client.attbi.com[12.234.89.252]) by rwcrmhc52.attbi.com (rwcrmhc52) with ESMTP id <2003022420224905200k1gpce>; Mon, 24 Feb 2003 20:22:49 +0000 Received: from blossom.cjclark.org (localhost. [127.0.0.1]) by blossom.cjclark.org (8.12.6/8.12.3) with ESMTP id h1OKMmeq040548; Mon, 24 Feb 2003 12:22:48 -0800 (PST) (envelope-from crist.clark@attbi.com) Received: (from cjc@localhost) by blossom.cjclark.org (8.12.6/8.12.6/Submit) id h1OKMl1m040547; Mon, 24 Feb 2003 12:22:47 -0800 (PST) X-Authentication-Warning: blossom.cjclark.org: cjc set sender to crist.clark@attbi.com using -f Date: Mon, 24 Feb 2003 12:22:46 -0800 From: "Crist J. Clark" To: Raymond Wiker Cc: freebsd-stable@freebsd.org Subject: Re: dhclient problem in stable Message-ID: <20030224202246.GA39984@blossom.cjclark.org> Reply-To: "Crist J. Clark" References: <15961.2003.461479.956760@raw.grenland.fast.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15961.2003.461479.956760@raw.grenland.fast.no> User-Agent: Mutt/1.4i X-URL: http://people.freebsd.org/~cjc/ Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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