From owner-freebsd-stable Sun Feb 23 9:41: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 2B47137B401 for ; Sun, 23 Feb 2003 09:41:51 -0800 (PST) Received: from nimitz.osl.fast.no (mailoslo.fast.no [217.144.235.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F48A43FAF for ; Sun, 23 Feb 2003 09:41:50 -0800 (PST) (envelope-from Raymond.Wiker@fast.no) Received: from raw.grenland.fast.no.fast.no (raw.grenland.fast.no [192.168.48.104]) by nimitz.osl.fast.no (8.12.3/8.12.3) with ESMTP id h1NHff76008115; Sun, 23 Feb 2003 18:41:41 +0100 (MET) (envelope-from Raymond.Wiker@fast.no) X-Authentication-Warning: nimitz.osl.fast.no: Host raw.grenland.fast.no [192.168.48.104] claimed to be raw.grenland.fast.no.fast.no From: Raymond Wiker MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15961.2003.461479.956760@raw.grenland.fast.no> Date: Sun, 23 Feb 2003 18:41:39 +0100 To: freebsd-stable@freebsd.org Subject: dhclient problem in stable X-Mailer: VM 7.07 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid 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 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. 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 :-) --- /usr/src/contrib/isc-dhcp/client/dhclient.c.org Thu Apr 11 12:16:45 2002 +++ /usr/src/contrib/isc-dhcp/client/dhclient.c Sun Feb 23 18:35:44 2003 @@ -784,7 +784,7 @@ client -> new -> renewal = 0; /* If it wasn't specified by the server, calculate it. */ - if (!client -> new -> renewal) + if (client -> new -> renewal <= 0) client -> new -> renewal = client -> new -> expiry / 2; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message