summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsashan <sashan@cvs.openbsd.org>2015-07-19 05:48:13 +0000
committersashan <sashan@cvs.openbsd.org>2015-07-19 05:48:13 +0000
commitc717895e7e7683e706ea60c3aa33403b49045524 (patch)
tree29fdd302c3c21cd89ce9a0072a9d54c4739ebb4e
parent180e222d017846266e43899483a4547a84a00fcb (diff)
unsinged variables should not be compared to be leq than 0 (unsigned a <= 0)
ok mcbride@
-rw-r--r--sys/net/pf.c6
-rw-r--r--sys/net/pf_ioctl.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 33b7ef5c65f..89aa5d9021a 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.930 2015/07/19 01:58:19 sashan Exp $ */
+/* $OpenBSD: pf.c,v 1.931 2015/07/19 05:48:11 sashan Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1217,7 +1217,7 @@ pf_purge_expired_src_nodes(int waslocked)
for (cur = RB_MIN(pf_src_tree, &tree_src_tracking); cur; cur = next) {
next = RB_NEXT(pf_src_tree, &tree_src_tracking, cur);
- if (cur->states <= 0 && cur->expire <= time_uptime) {
+ if (cur->states == 0 && cur->expire <= time_uptime) {
if (! locked) {
rw_enter_write(&pf_consistency_lock);
next = RB_NEXT(pf_src_tree,
@@ -1242,7 +1242,7 @@ pf_src_tree_remove_state(struct pf_state *s)
SLIST_REMOVE_HEAD(&s->src_nodes, next);
if (s->src.tcp_est)
--sni->sn->conn;
- if (--sni->sn->states <= 0) {
+ if (--sni->sn->states == 0) {
timeout = s->rule.ptr->timeout[PFTM_SRC_NODE];
if (!timeout)
timeout =
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index 3e183ea4799..a59da8f195d 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.286 2015/07/18 19:19:00 sashan Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.287 2015/07/19 05:48:12 sashan Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -249,7 +249,7 @@ void
pf_rm_rule(struct pf_rulequeue *rulequeue, struct pf_rule *rule)
{
if (rulequeue != NULL) {
- if (rule->states_cur <= 0 && rule->src_nodes <= 0) {
+ if (rule->states_cur == 0 && rule->src_nodes == 0) {
/*
* XXX - we need to remove the table *before* detaching
* the rule to make sure the table code does not delete