[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dhcp-client segfaults on powerpc



At 11:46 +0200 15 Jul 2001, Martin Michlmayr <tbm@cyrius.com> wrote:
> Bug #103813 claims that dhcp-client segfaults on powerpc immediately
> after obtaining an IP address.  First of all, can someone with a
> powerpc system please try to reproduce this problem.   If you see it

Yes, I can reproduce it.

> as well, can you please compile dhcp-client from experimental and try
> if that works.

I don't know what you mean by experimental, so I haven't done that.

> This is holding up the freeze of the base system, so please look into
> this asap.  A patch against the current version in unstable would be
> great, too, btw. ;)

It was a bit hard to track down, since gdb doesn't seem to find any
debugging information (I was trying with un-stripped copies).  But, I
think I've found the problem.  It's simply following a NULL pointer when
trying to read the lease time.  Patch follows.

--- client/dhclient.c.dist	Sun Jul 15 15:20:41 2001
+++ client/dhclient.c	Sun Jul 15 15:22:41 2001
@@ -543,7 +543,11 @@
 	cancel_timeout (send_request, ip);
 
 	/* Figure out the lease time. */
-	ip -> client -> new -> expiry =
+	if (ip -> client -> new -> options [DHO_DHCP_LEASE_TIME].len
+	    < sizeof (u_int32_t))
+	    ip -> client -> new -> expiry = TIME_MAX;
+	else
+	    ip -> client -> new -> expiry =
 		getULong (ip -> client ->
 			  new -> options [DHO_DHCP_LEASE_TIME].data);
 	/* A number that looks negative here is really just very large,

-- 
Aaron Schrab     aaron@schrab.com      http://www.execpc.com/~aarons/
 Real programmers can write assembly code in any language.   :-)
   --Larry Wall



Reply to: