From owner-freebsd-sparc Fri Sep 20 14:11:16 2002 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5346737B401 for ; Fri, 20 Sep 2002 14:11:12 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id E3BB243E77 for ; Fri, 20 Sep 2002 14:11:05 -0700 (PDT) (envelope-from tmoestl@gmx.net) Received: (qmail 8319 invoked by uid 0); 20 Sep 2002 21:11:03 -0000 Received: from pd9e16274.dip.t-dialin.net (HELO forge.local) (217.225.98.116) by mail.gmx.net (mp019-rz3) with SMTP; 20 Sep 2002 21:11:03 -0000 Received: from tmm by forge.local with local (Exim 4.10 #1) id 17sV4I-000GBG-00 for ; Fri, 20 Sep 2002 23:12:06 +0200 Date: Fri, 20 Sep 2002 23:12:05 +0200 From: Thomas Moestl To: freebsd-sparc@freebsd.org Subject: Fix for dhclient problems Message-ID: <20020920211205.GA16973@crow.dom2ip.de> Mail-Followup-To: freebsd-sparc@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, I've attached a patch that should fix the problems with dhclient that people were seeing. I'll try to get this committed soon. - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C Index: common/bpf.c =================================================================== RCS file: /home/ncvs/src/contrib/isc-dhcp/common/bpf.c,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 bpf.c --- common/bpf.c 19 Feb 2002 11:04:33 -0000 1.1.1.6 +++ common/bpf.c 20 Sep 2002 21:10:03 -0000 @@ -241,6 +241,7 @@ u_int32_t addr; struct bpf_program p; u_int32_t bits; + u_int rbuf_max; #ifdef DEC_FDDI int link_layer; #endif /* DEC_FDDI */ @@ -278,8 +279,9 @@ log_fatal ("Can't set ENBATCH|ENCOPYALL|ENBPFHDR: %m"); #endif /* Get the required BPF buffer length from the kernel. */ - if (ioctl (info -> rfdesc, BIOCGBLEN, &info -> rbuf_max) < 0) + if (ioctl (info -> rfdesc, BIOCGBLEN, &rbuf_max) < 0) log_fatal ("Can't get bpf buffer length: %m"); + info -> rbuf_max = rbuf_max; info -> rbuf = dmalloc (info -> rbuf_max, MDL); if (!info -> rbuf) log_fatal ("Can't allocate %ld bytes for bpf input buffer.", Index: common/convert.c =================================================================== RCS file: /home/ncvs/src/contrib/isc-dhcp/common/convert.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 convert.c --- common/convert.c 10 Feb 1999 09:10:13 -0000 1.1.1.1 +++ common/convert.c 20 Sep 2002 21:10:03 -0000 @@ -51,7 +51,7 @@ u_int32_t getULong (buf) unsigned char *buf; { - unsigned long ibuf; + u_int32_t ibuf; memcpy (&ibuf, buf, sizeof (u_int32_t)); return ntohl (ibuf); @@ -60,7 +60,7 @@ int32_t getLong (buf) unsigned char *buf; { - long ibuf; + int32_t ibuf; memcpy (&ibuf, buf, sizeof (int32_t)); return ntohl (ibuf); @@ -69,7 +69,7 @@ u_int16_t getUShort (buf) unsigned char *buf; { - unsigned short ibuf; + u_int16_t ibuf; memcpy (&ibuf, buf, sizeof (u_int16_t)); return ntohs (ibuf); @@ -78,7 +78,7 @@ int16_t getShort (buf) unsigned char *buf; { - short ibuf; + int16_t ibuf; memcpy (&ibuf, buf, sizeof (int16_t)); return ntohs (ibuf); Index: omapip/convert.c =================================================================== RCS file: /home/ncvs/src/contrib/isc-dhcp/omapip/convert.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 convert.c --- omapip/convert.c 19 Feb 2002 11:04:32 -0000 1.1.1.1 +++ omapip/convert.c 20 Sep 2002 21:10:03 -0000 @@ -52,7 +52,7 @@ u_int32_t getULong (buf) const unsigned char *buf; { - unsigned long ibuf; + u_int32_t ibuf; memcpy (&ibuf, buf, sizeof (u_int32_t)); return ntohl (ibuf); @@ -61,7 +61,7 @@ int32_t getLong (buf) const unsigned char *buf; { - long ibuf; + int32_t ibuf; memcpy (&ibuf, buf, sizeof (int32_t)); return ntohl (ibuf); @@ -70,7 +70,7 @@ u_int32_t getUShort (buf) const unsigned char *buf; { - unsigned short ibuf; + u_int16_t ibuf; memcpy (&ibuf, buf, sizeof (u_int16_t)); return ntohs (ibuf); @@ -79,7 +79,7 @@ int32_t getShort (buf) const unsigned char *buf; { - short ibuf; + int16_t ibuf; memcpy (&ibuf, buf, sizeof (int16_t)); return ntohs (ibuf); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message