From owner-freebsd-current@FreeBSD.ORG Thu Jul 28 01:25:28 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CB9FD16A41F for ; Thu, 28 Jul 2005 01:25:28 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BF9C43D48 for ; Thu, 28 Jul 2005 01:25:28 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j6S1PRgN024305 for ; Wed, 27 Jul 2005 18:25:27 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j6S1PRM6024304 for current@freebsd.org; Wed, 27 Jul 2005 18:25:27 -0700 Date: Wed, 27 Jul 2005 18:25:27 -0700 From: Brooks Davis To: current@freebsd.org Message-ID: <20050728012527.GA23648@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: Subject: another dhclient patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2005 01:25:29 -0000 --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Here's another dhclient patch to address another bug in the bpf code by correctly using BPF_WORDALIGN to advance the pointer. It assumes the previous patch (as committed to HEAD) has been applied. I've got a couple systems running this with debug compiled versons so if we still have bpf related bugs, I should be able to find them. -- Brooks ----- Forwarded message from Brooks Davis ----- From: Brooks Davis Date: Thu, 28 Jul 2005 01:18:21 GMT To: Perforce Change Reviews Subject: PERFORCE change 81096 for review http://perforce.freebsd.org/chv.cgi?CH=3D81096 Change 81096 by brooks@brooks_pagefault on 2005/07/28 01:17:44 Futher BPF handing fixes. Use BPF_WORDALIGN when incrementing the pointer. From ISC via krw at OpenBSD. Affected files ... =2E. //depot/user/brooks/cleanup/sbin/dhclient/bpf.c#6 edit Differences ... =3D=3D=3D=3D //depot/user/brooks/cleanup/sbin/dhclient/bpf.c#6 (text+ko) = =3D=3D=3D=3D @@ -325,7 +325,9 @@ * do is drop it. */ if (hdr.bh_caplen !=3D hdr.bh_datalen) { - interface->rbuf_offset +=3D hdr.bh_caplen; + interface->rbuf_offset =3D + BPF_WORDALIGN(interface->rbuf_offset + + hdr.bh_caplen); continue; } =20 @@ -339,7 +341,9 @@ * this packet. */ if (offset < 0) { - interface->rbuf_offset +=3D hdr.bh_caplen; + interface->rbuf_offset =3D + BPF_WORDALIGN(interface->rbuf_offset + + hdr.bh_caplen); continue; } interface->rbuf_offset +=3D offset; @@ -351,7 +355,9 @@ =20 /* If the IP or UDP checksum was bad, skip the packet... */ if (offset < 0) { - interface->rbuf_offset +=3D hdr.bh_caplen; + interface->rbuf_offset =3D + BPF_WORDALIGN(interface->rbuf_offset + + hdr.bh_caplen); continue; } interface->rbuf_offset +=3D offset; @@ -363,14 +369,18 @@ * life, though). */ if (hdr.bh_caplen > len) { - interface->rbuf_offset +=3D hdr.bh_caplen; + interface->rbuf_offset =3D + BPF_WORDALIGN(interface->rbuf_offset + + hdr.bh_caplen); continue; } =20 /* Copy out the data in the packet... */ memcpy(buf, interface->rbuf + interface->rbuf_offset, hdr.bh_caplen); - interface->rbuf_offset +=3D hdr.bh_caplen; + interface->rbuf_offset =3D + BPF_WORDALIGN(interface->rbuf_offset + + hdr.bh_caplen); return (hdr.bh_caplen); } while (!length); return (0); ----- End forwarded message ----- --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --fUYQa+Pmc3FrFX/N Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFC6DQHXY6L6fI4GtQRAmvaAJ0ZZYRJVQyWnvdLeqww/yPtp4WXRgCgqpZp PSfL59+SEGCJDj3IOEjv9Es= =l15E -----END PGP SIGNATURE----- --fUYQa+Pmc3FrFX/N--