diff options
author | ae <ae@FreeBSD.org> | 2013-07-09 15:20:46 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2013-07-09 15:20:46 +0000 |
commit | 9bfe2ac5dd08af286e1fbba35062cd9f06b0e111 (patch) | |
tree | 304fc28ed1fce52891f3d3739a1cbce5676957f0 /sys/netinet6/in6.c | |
parent | 89cf4181969ecbc9b24b049bb5cf834f0dbe967c (diff) | |
download | FreeBSD-src-9bfe2ac5dd08af286e1fbba35062cd9f06b0e111.zip FreeBSD-src-9bfe2ac5dd08af286e1fbba35062cd9f06b0e111.tar.gz |
Correct the size of allocated memory to store array of counters.
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r-- | sys/netinet6/in6.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index e0a9128..f8c2b7e 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -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); |