Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Feb 2003 18:41:39 +0100
From:      Raymond Wiker <Raymond.Wiker@fast.no>
To:        freebsd-stable@freebsd.org
Subject:   dhclient problem in stable
Message-ID:  <15961.2003.461479.956760@raw.grenland.fast.no>

next in thread | raw e-mail | index | archive | help
        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




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