summaryrefslogtreecommitdiff
path: root/sys/net/pf.c
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2009-04-14 19:39:57 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2009-04-14 19:39:57 +0000
commit5d4008f3303824ccf7dc7cccd7fd2bb0bddb2669 (patch)
tree197cfa9b7d0e5279da6f3e2dfd19968b407fc8fd /sys/net/pf.c
parentfb7a573319c1d647a7d91ec3d895cf9b95309a1d (diff)
Correctly handle the case when state might be NULL in pf_test like
all other code do. Should fix pr 6121. ok henning@
Diffstat (limited to 'sys/net/pf.c')
-rw-r--r--sys/net/pf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 9b9b0b3cd2c..d64eeb2c112 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.641 2009/04/11 23:42:05 jsing Exp $ */
+/* $OpenBSD: pf.c,v 1.642 2009/04/14 19:39:56 grange Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -5639,10 +5639,12 @@ done:
if (log == PF_LOG_FORCE || lr->log & PF_LOG_ALL)
PFLOG_PACKET(kif, h, m, AF_INET, dir, reason, lr, a,
ruleset, &pd);
- SLIST_FOREACH(ri, &s->match_rules, entry)
- if (ri->r->log & PF_LOG_ALL)
- PFLOG_PACKET(kif, h, m, AF_INET, dir, reason,
- ri->r, a, ruleset, &pd);
+ if (s) {
+ SLIST_FOREACH(ri, &s->match_rules, entry)
+ if (ri->r->log & PF_LOG_ALL)
+ PFLOG_PACKET(kif, h, m, AF_INET, dir,
+ reason, ri->r, a, ruleset, &pd);
+ }
}
kif->pfik_bytes[0][dir == PF_OUT][action != PF_PASS] += pd.tot_len;