From owner-freebsd-net@FreeBSD.ORG Tue Feb 7 16:38:33 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC43016A420 for ; Tue, 7 Feb 2006 16:38:33 +0000 (GMT) (envelope-from james.juran@baesystems.com) Received: from smtp4.na.baesystems.com (smtp4.na.baesystems.com [63.164.202.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37BCC43D45 for ; Tue, 7 Feb 2006 16:38:31 +0000 (GMT) (envelope-from james.juran@baesystems.com) Received: from BLUMS0022.bluelnk.net (blums0022.na.baesystems.com [10.40.96.145]) by smtp4.na.baesystems.com (8.12.10/8.12.10) with ESMTP id k17GcUfW008060 for ; Tue, 7 Feb 2006 11:38:30 -0500 (EST) Received: from vahqex3.digitalnet.com (vahqex3.gfgsi.com [159.94.37.43]) by smtp1.na.baesystems.com (8.12.10/8.12.10) with ESMTP id k17GcHNr002115 for ; Tue, 7 Feb 2006 11:38:17 -0500 (EST) Received: from juran.digitalnet.com ([159.94.6.27]) by vahqex3.digitalnet.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 7 Feb 2006 11:38:10 -0500 Received: from localhost (localhost [127.0.0.1]) by juran.digitalnet.com (8.13.4/8.13.4) with ESMTP id k17GcAOv018541 for ; Tue, 7 Feb 2006 11:38:10 -0500 From: James Juran To: freebsd-net@freebsd.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Y6lvKWoTEX8WbUpefxAQ" Organization: BAE Systems Information Technology, LLC Date: Tue, 07 Feb 2006 11:38:09 -0500 Message-Id: <1139330290.13750.11.camel@juran.digitalnet.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) X-OriginalArrivalTime: 07 Feb 2006 16:38:10.0656 (UTC) FILETIME=[E1CEDE00:01C62C04] Subject: Zeroing wrong union member in in6_control() X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2006 16:38:33 -0000 --=-Y6lvKWoTEX8WbUpefxAQ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable In what looks like a copy&paste remnant from the preceding case, the wrong union member is used as the first argument to bzero in in6_control(). This doesn't cause an actual bug, but making this change would improve code clarity and robustness to change and also avoids a warning from a certain static analysis tool. I'm not a regular FreeBSD contributor, so if this patch is worthwhile can someone please apply it? If I should send things like this to a different mailing list in the future, please let me know. Index: in6.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/netinet6/in6.c,v retrieving revision 1.59 diff -u -p -f -u -p -r1.59 in6.c --- in6.c 31 Oct 2005 23:06:04 -0000 1.59 +++ in6.c 7 Feb 2006 16:30:21 -0000 @@ -568,7 +568,7 @@ in6_control(so, cmd, data, ifp, td) case SIOCGIFSTAT_ICMP6: if (ifp =3D=3D NULL) return EINVAL; - bzero(&ifr->ifr_ifru.ifru_stat, + bzero(&ifr->ifr_ifru.ifru_icmp6stat, sizeof(ifr->ifr_ifru.ifru_icmp6stat)); ifr->ifr_ifru.ifru_icmp6stat =3D *((struct in6_ifextra *)ifp->if_afdata[AF_INET6])->icmp6_ifstat; --=20 James Juran Senior Secure Systems Analyst XTS-400 Operating Systems BAE Systems Information Technology James.Juran@baesystems.com (703) 563-8081 --=-Y6lvKWoTEX8WbUpefxAQ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBD6Mzx5VGI7rYqFQsRAtljAJ0ajT3zXUkcDFly4U0DII+IFHz4kACfUh0n tGTDpxYlMMj14mMrj2qE7fM= =/YCe -----END PGP SIGNATURE----- --=-Y6lvKWoTEX8WbUpefxAQ--