From owner-svn-src-all@FreeBSD.ORG Wed Jul 1 07:25:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FC2D106564A; Wed, 1 Jul 2009 07:25:30 +0000 (UTC) (envelope-from prvs=1426fb8461=brian@Awfulhak.org) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id D132D8FC08; Wed, 1 Jul 2009 07:25:29 +0000 (UTC) (envelope-from prvs=1426fb8461=brian@Awfulhak.org) Received: from pd6ml1no-ssvc.prod.shaw.ca ([10.0.153.160]) by pd7mo1no-svcs.prod.shaw.ca with ESMTP; 01 Jul 2009 00:56:51 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=0 a=5aTBxeKp6XyzOodXBGAA:9 a=B9Ao4QmpTKR_GM9Pi8dXpimq8JIA:4 a=SV7veod9ZcQA:10 a=WJ3hkfHDukgA:10 a=Tu6obrnSMPRxD4wid8cA:9 a=NISQWNpZJYqgjPKInZ0zqbRj0-oA:4 a=c1gA0selgUcA:10 Received: from unknown (HELO store.lan.Awfulhak.org) ([174.7.23.140]) by pd6ml1no-dmz.prod.shaw.ca with ESMTP; 01 Jul 2009 00:56:51 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 030F1C433AC_A4B08E6B; Wed, 1 Jul 2009 06:57:41 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id 8AF76C460FE_A4B08DBF; Wed, 1 Jul 2009 06:57:31 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.3/8.14.3) with ESMTP id n616udnL056566; Tue, 30 Jun 2009 23:56:39 -0700 (PDT) (envelope-from brian@Awfulhak.org) Date: Tue, 30 Jun 2009 23:56:24 -0700 From: Brian Somers To: Stanislav Sedov Message-ID: <20090630235624.13a526dc@dev.lan.Awfulhak.org> In-Reply-To: <20090701014553.32117b64.stas@FreeBSD.org> References: <200906301851.n5UIpNJQ089171@svn.freebsd.org> <20090701014553.32117b64.stas@FreeBSD.org> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.2; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/_Mbuao.zX.sOdKlwNnjU7um"; protocol="application/pgp-signature" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Martin Blapp , Marc Balmer , src-committers@FreeBSD.org Subject: Re: svn commit: r195200 - in head/usr.sbin: . wake X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2009 07:25:30 -0000 --Sig_/_Mbuao.zX.sOdKlwNnjU7um Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 1 Jul 2009 01:45:53 +0400 Stanislav Sedov wrote: > > + p =3D (u_char *)&pkt; > > + len =3D sizeof(pkt); > > + bw =3D 0; > > + while (len) { > > + if ((bw =3D write(bpf, &pkt, sizeof(pkt))) =3D=3D -1) > > + return -1; > > + len -=3D bw; > > + p +=3D bw; > > + } > > + return 0; > > +} >=20 > What the "p" pointer is used here for? I don't see any usage for it besi= des > incrementing it in the loop. Am I missing something? The write() has two bugs. It should be write(bpf, p, len). --=20 Brian Somers Don't _EVER_ lose your sense of humour ! --Sig_/_Mbuao.zX.sOdKlwNnjU7um Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iQCVAwUBSksIpw7tvOdmanQhAQLTwwQAr74bKV9Ebbp4kJf2u9ZPnB5c5v0xKo65 A9w5AFgrvyjhJQibHuKrB2S5GCotk5M8y26Mwkwms7Ns8H3DKDus9xPYJygkas7V qhGGO6P/CWayDBK1gxS+wXDNQTZ6XYjcehP2z2wW4Mj8SnqdciCb4sjH0CJNxiqS xFxExqtQH0I= =+zw0 -----END PGP SIGNATURE----- --Sig_/_Mbuao.zX.sOdKlwNnjU7um--