summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-08-19 19:57:34 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-08-19 19:57:34 +0000
commit7d042fe38a604a672d0224bc5189119007cb2adb (patch)
tree67fe81510164c6c3a5ea68a52d22fa9edef1c570
parent4e7dc635a689ed7435ec4c0c0a98fb6158fb2d09 (diff)
do not spin if no states are found
-rw-r--r--sbin/pfctl/pfctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 2b0c7e680df..819a03e3c7e 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.35 2001/08/19 19:03:58 dhartmei Exp $ */
+/* $OpenBSD: pfctl.c,v 1.36 2001/08/19 19:57:33 deraadt Exp $ */
/*
* Copyright (c) 2001, Daniel Hartmeier
@@ -242,6 +242,8 @@ pfctl_show_states(int dev, u_int8_t proto)
break;
if (len == 0 && ps.ps_len != 0)
len = ps.ps_len;
+ if (ps.ps_len == 0)
+ return (0); /* no states */
len *= 2;
}
p = ps.ps_states;