svn commit: r253101 - head/sys/netinet6

Andrey V. Elsukov ae at FreeBSD.org
Tue Jul 9 15:20:47 UTC 2013


Author: ae
Date: Tue Jul  9 15:20:46 2013
New Revision: 253101
URL: http://svnweb.freebsd.org/changeset/base/253101

Log:
  Correct the size of allocated memory to store array of counters.

Modified:
  head/sys/netinet6/in6.c

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Tue Jul  9 15:10:27 2013	(r253100)
+++ head/sys/netinet6/in6.c	Tue Jul  9 15:20:46 2013	(r253101)
@@ -2749,12 +2749,13 @@ in6_domifattach(struct ifnet *ifp)
 	ext = (struct in6_ifextra *)malloc(sizeof(*ext), M_IFADDR, M_WAITOK);
 	bzero(ext, sizeof(*ext));
 
-	ext->in6_ifstat = malloc(sizeof(struct in6_ifstat), M_IFADDR,
-	    M_WAITOK);
+	ext->in6_ifstat = malloc(sizeof(counter_u64_t) *
+	    sizeof(struct in6_ifstat) / sizeof(uint64_t), M_IFADDR, M_WAITOK);
 	COUNTER_ARRAY_ALLOC(ext->in6_ifstat,
 	    sizeof(struct in6_ifstat) / sizeof(uint64_t), M_WAITOK);
 
-	ext->icmp6_ifstat = malloc(sizeof(struct icmp6_ifstat), M_IFADDR,
+	ext->icmp6_ifstat = malloc(sizeof(counter_u64_t) *
+	    sizeof(struct icmp6_ifstat) / sizeof(uint64_t), M_IFADDR,
 	    M_WAITOK);
 	COUNTER_ARRAY_ALLOC(ext->icmp6_ifstat,
 	    sizeof(struct icmp6_ifstat) / sizeof(uint64_t), M_WAITOK);


More information about the svn-src-all mailing list