Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Feb 2006 11:38:09 -0500
From:      James Juran <James.Juran@baesystems.com>
To:        freebsd-net@freebsd.org
Subject:   Zeroing wrong union member in in6_control()
Message-ID:  <1139330290.13750.11.camel@juran.digitalnet.com>

next in thread | raw e-mail | index | archive | help

--=-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--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1139330290.13750.11.camel>