From owner-freebsd-sparc64@FreeBSD.ORG Sun Feb 22 16:57:08 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53B0916A4CE for ; Sun, 22 Feb 2004 16:57:08 -0800 (PST) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 12C7043D1D for ; Sun, 22 Feb 2004 16:57:08 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i1N0v5nI028791; Sun, 22 Feb 2004 19:57:05 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: <20040215060047.GA62840@dhcp01.pn.xcllnt.net> <20040215165913.M30161@grogged.dyndns.org> Date: Sun, 22 Feb 2004 19:57:04 -0500 To: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= ) From: Garance A Drosihn Content-Type: text/plain; charset="iso-8859-1" ; format="flowed" Content-Transfer-Encoding: quoted-printable X-Scanned-By: CanIt (www . canit . ca) cc: sparc64@freebsd.org Subject: Re: Problem with DHCLIENT vs 64-bit time_t X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2004 00:57:08 -0000 At 11:45 AM +0100 2/22/04, Dag-Erling Sm=F8rgrav wrote: >Garance A Drosihn writes: >> So, there definitely is something wrong with the dhclient from >> the base system But it might be that people having trouble with >> dhcp on 64-bTT sparc systems could use the port, at least for >> the short-term. > >Only takes a few minutes of eyeballing to figure out that the problem >is most likely on line 424 of src/contrib/isc-dhcp/common/parse.c: > > convert_num (cfile, (unsigned char *)timep, val, 10, 32); > >idiotically, the final argument to convert_num() is supposed to be >the size in bits of the number to store in the location pointed to >by the second argument. The simplest fix is to use a temporary >int32_t and assign it to *timep later, since convert_num() can't >deal with 64-bit quantities. See attached (untested) patch. Well, that definitely looks like a problem, but it may not be the only one. I tried applying your patch, recompiling, and installing. dhclient still seems to hang up on me. This was just a quick test, though, so I may have done something wrong. In a later message, Dag-Erling Sm=F8rgrav wrote: >Marcel Moolenaar writes: >> This code is then obviously also broken on amd64 and ia64 [...] > >yep, if they have 64-bit time_t. They do, but they are also different-endian. Perhaps the bug is not as serious in that case. It could also be that the people able to spend money on amd64 and ia64 can also afford to have fixed IP addresses, and they don't run dhclient :-) [or maybe they are running the version from /usr/ports] -- Garance Alistair Drosehn =3D gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu