Date: Tue, 9 Jul 2013 15:20:46 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253101 - head/sys/netinet6 Message-ID: <201307091520.r69FKkBS037607@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307091520.r69FKkBS037607>