From 5d4008f3303824ccf7dc7cccd7fd2bb0bddb2669 Mon Sep 17 00:00:00 2001 From: Alexander Yurchenko Date: Tue, 14 Apr 2009 19:39:57 +0000 Subject: Correctly handle the case when state might be NULL in pf_test like all other code do. Should fix pr 6121. ok henning@ --- sys/net/pf.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sys/net/pf.c') 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; -- cgit v1.2.3