summaryrefslogtreecommitdiffstats
path: root/sys/netpfil/ipfw/ip_fw_sockopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netpfil/ipfw/ip_fw_sockopt.c')
-rw-r--r--sys/netpfil/ipfw/ip_fw_sockopt.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c
index e71019a..3363cf9 100644
--- a/sys/netpfil/ipfw/ip_fw_sockopt.c
+++ b/sys/netpfil/ipfw/ip_fw_sockopt.c
@@ -175,9 +175,7 @@ ipfw_add_rule(struct ip_fw_chain *chain, struct ip_fw *input_rule)
/* clear fields not settable from userland */
rule->x_next = NULL;
rule->next_rule = NULL;
- rule->pcnt = 0;
- rule->bcnt = 0;
- rule->timestamp = 0;
+ IPFW_ZERO_RULE_COUNTER(rule);
if (V_autoinc_step < 1)
V_autoinc_step = 1;
@@ -382,7 +380,7 @@ del_entry(struct ip_fw_chain *chain, uint32_t arg)
continue;
l = RULESIZE(rule);
chain->static_len -= l;
- ipfw_remove_dyn_children(rule);
+ ipfw_expire_dyn_rules(chain, rule, RESVD_SET);
rule->x_next = chain->reap;
chain->reap = rule;
}
@@ -439,10 +437,8 @@ clear_counters(struct ip_fw *rule, int log_only)
{
ipfw_insn_log *l = (ipfw_insn_log *)ACTION_PTR(rule);
- if (log_only == 0) {
- rule->bcnt = rule->pcnt = 0;
- rule->timestamp = 0;
- }
+ if (log_only == 0)
+ IPFW_ZERO_RULE_COUNTER(rule);
if (l->o.opcode == O_LOG)
l->log_left = l->max_log;
}
@@ -925,7 +921,7 @@ ipfw_getrules(struct ip_fw_chain *chain, void *buf, size_t space)
dst->timestamp += boot_seconds;
bp += l;
}
- ipfw_get_dynamic(&bp, ep); /* protected by the dynamic lock */
+ ipfw_get_dynamic(chain, &bp, ep); /* protected by the dynamic lock */
return (bp - (char *)buf);
}
OpenPOWER on IntegriCloud