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);
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to