Zeroing wrong union member in in6_control()

James Juran James.Juran at baesystems.com
Tue Feb 7 08:38:33 PST 2006


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
===================================================================
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 == 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 =
 		    *((struct in6_ifextra *)ifp->if_afdata[AF_INET6])->icmp6_ifstat;



-- 
James Juran
Senior Secure Systems Analyst
XTS-400 Operating Systems
BAE Systems Information Technology
James.Juran at baesystems.com
(703) 563-8081
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20060207/597de9be/attachment.bin


More information about the freebsd-net mailing list