From owner-svn-src-head@FreeBSD.ORG Tue Jul 9 15:20:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F291C161; Tue, 9 Jul 2013 15:20:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E5CD3177F; Tue, 9 Jul 2013 15:20:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69FKkgd037608; Tue, 9 Jul 2013 15:20:46 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69FKkBS037607; Tue, 9 Jul 2013 15:20:46 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307091520.r69FKkBS037607@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 9 Jul 2013 15:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253101 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jul 2013 15:20:47 -0000 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);