summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2014-07-02 13:04:51 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2014-07-02 13:04:51 +0000
commit6c84a41d8bc7af4f41369115983aca67a73d2747 (patch)
tree93fd68026fb0d3409802aee3ba04f3048ce53de8 /sys
parente0f3f13d7a95a2bc780a247deca635232de1aaa2 (diff)
u_int32_t's can't go negative
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index fbb8fbaae8c..e8b5fc24940 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.879 2014/06/25 16:21:20 mikeb Exp $ */
+/* $OpenBSD: pf.c,v 1.880 2014/07/02 13:04:50 mikeb Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -584,8 +584,8 @@ pf_remove_src_node(struct pf_src_node *sn)
if (sn->rule.ptr != NULL) {
sn->rule.ptr->src_nodes--;
- if (sn->rule.ptr->states_cur <= 0 &&
- sn->rule.ptr->src_nodes <= 0)
+ if (sn->rule.ptr->states_cur == 0 &&
+ sn->rule.ptr->src_nodes == 0)
pf_rm_rule(NULL, sn->rule.ptr);
RB_REMOVE(pf_src_tree, &tree_src_tracking, sn);
pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++;
@@ -1307,16 +1307,16 @@ pf_free_state(struct pf_state *cur)
return;
#endif
KASSERT(cur->timeout == PFTM_UNLINKED);
- if (--cur->rule.ptr->states_cur <= 0 &&
- cur->rule.ptr->src_nodes <= 0)
+ if (--cur->rule.ptr->states_cur == 0 &&
+ cur->rule.ptr->src_nodes == 0)
pf_rm_rule(NULL, cur->rule.ptr);
if (cur->anchor.ptr != NULL)
- if (--cur->anchor.ptr->states_cur <= 0)
+ if (--cur->anchor.ptr->states_cur == 0)
pf_rm_rule(NULL, cur->anchor.ptr);
while ((ri = SLIST_FIRST(&cur->match_rules))) {
SLIST_REMOVE_HEAD(&cur->match_rules, entry);
- if (--ri->r->states_cur <= 0 &&
- ri->r->src_nodes <= 0)
+ if (--ri->r->states_cur == 0 &&
+ ri->r->src_nodes == 0)
pf_rm_rule(NULL, ri->r);
pool_put(&pf_rule_item_pl, ri);
}