summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsashan <sashan@openbsd.org>2015-07-19 05:48:11 +0000
committersashan <sashan@openbsd.org>2015-07-19 05:48:11 +0000
commit454162ba1ce7d347c01681e1a6aecc8433d5cb80 (patch)
tree8a9f3c2ff01b1fb01a7a996b86591d6f565566fe /sys
parentNow that it is safe to invoke X509_STORE_CTX_cleanup() if X509_STORE_CTX_init() (diff)
downloadwireguard-openbsd-454162ba1ce7d347c01681e1a6aecc8433d5cb80.tar.xz
wireguard-openbsd-454162ba1ce7d347c01681e1a6aecc8433d5cb80.zip
unsinged variables should not be compared to be leq than 0 (unsigned a <= 0)
ok mcbride@
Diffstat (limited to 'sys')
-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