diff options
author | 2009-04-14 19:39:56 +0000 | |
---|---|---|
committer | 2009-04-14 19:39:56 +0000 | |
commit | b692f79c8540ed0911b5afdf00b22f91280e3fd1 (patch) | |
tree | cf9269e73e32a452098b6268e1321577d312f82b | |
parent | Route costs can be safely stored in one byte. (diff) | |
download | wireguard-openbsd-b692f79c8540ed0911b5afdf00b22f91280e3fd1.tar.xz wireguard-openbsd-b692f79c8540ed0911b5afdf00b22f91280e3fd1.zip |
Correctly handle the case when state might be NULL in pf_test like
all other code do. Should fix pr 6121.
ok henning@
-rw-r--r-- | sys/net/pf.c | 12 |
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; |