From owner-svn-src-head@FreeBSD.ORG Sat Oct 18 17:23:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06ABDC5B; Sat, 18 Oct 2014 17:23:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6AB86C1; Sat, 18 Oct 2014 17:23:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9IHNgoK055976; Sat, 18 Oct 2014 17:23:42 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9IHNg1A055974; Sat, 18 Oct 2014 17:23:42 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201410181723.s9IHNg1A055974@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 18 Oct 2014 17:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273260 - head/sys/netpfil/ipfw 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.18-1 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: Sat, 18 Oct 2014 17:23:43 -0000 Author: melifaro Date: Sat Oct 18 17:23:41 2014 New Revision: 273260 URL: https://svnweb.freebsd.org/changeset/base/273260 Log: Use IPFW_RULE_CNTR_SIZE macro instead of non-relevant ip_fw_cntr structure. Found by: luigi Modified: head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Sat Oct 18 17:11:02 2014 (r273259) +++ head/sys/netpfil/ipfw/ip_fw_private.h Sat Oct 18 17:23:41 2014 (r273260) @@ -226,12 +226,6 @@ VNET_DECLARE(unsigned int, fw_tables_set struct tables_config; #ifdef _KERNEL -typedef struct ip_fw_cntr { - uint64_t pcnt; /* Packet counter */ - uint64_t bcnt; /* Byte counter */ - uint64_t timestamp; /* tv_sec of last match */ -} ip_fw_cntr; - /* * Here we have the structure representing an ipfw rule. * @@ -261,6 +255,8 @@ struct ip_fw { ipfw_insn cmd[1]; /* storage for commands */ }; +#define IPFW_RULE_CNTR_SIZE (2 * sizeof(counter_u64_t)) + #endif struct ip_fw_chain { Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Sat Oct 18 17:11:02 2014 (r273259) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Sat Oct 18 17:23:41 2014 (r273260) @@ -162,7 +162,7 @@ ipfw_init_counters() { V_ipfw_cntr_zone = uma_zcreate("IPFW counters", - sizeof(ip_fw_cntr), NULL, NULL, NULL, NULL, + IPFW_RULE_CNTR_SIZE, NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); }