Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Oct 2014 17:23:42 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273260 - head/sys/netpfil/ipfw
Message-ID:  <201410181723.s9IHNg1A055974@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410181723.s9IHNg1A055974>