diff options
author | 2008-06-11 03:36:33 +0000 | |
---|---|---|
committer | 2008-06-11 03:36:33 +0000 | |
commit | 941a5f5c222c92e24a4f13d147f87f274532a74c (patch) | |
tree | 8664f9f0fded4a22d63b70f285a7f72a8f7d92a6 | |
parent | after finding a state in the outbound path clear the statekey pointer (diff) | |
download | wireguard-openbsd-941a5f5c222c92e24a4f13d147f87f274532a74c.tar.xz wireguard-openbsd-941a5f5c222c92e24a4f13d147f87f274532a74c.zip |
superfluous to check for m != NULL in pf_find_state, it is plain
impossible that m is NULL here since all callers dereference it
unconditionally beforehands, and find state without and mbuf doesn't
make sense in the first place
-rw-r--r-- | sys/net/pf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 697cfdd986a..e8216a12de2 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.593 2008/06/11 03:28:10 henning Exp $ */ +/* $OpenBSD: pf.c,v 1.594 2008/06/11 03:36:33 henning Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -870,19 +870,19 @@ pf_find_state(struct pfi_kif *kif, struct pf_state_key_cmp *key, u_int dir, pf_status.fcounters[FCNT_STATE_SEARCH]++; - if (dir == PF_OUT && m && m->m_pkthdr.pf.statekey && + if (dir == PF_OUT && m->m_pkthdr.pf.statekey && ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->reverse) sk = ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->reverse; else { if ((sk = RB_FIND(pf_state_tree, &pf_statetbl, (struct pf_state_key *)key)) == NULL) return (NULL); - if (m && m->m_pkthdr.pf.statekey) + if (m->m_pkthdr.pf.statekey) ((struct pf_state_key *) m->m_pkthdr.pf.statekey)->reverse = sk; } - if (dir == PF_OUT && m) + if (dir == PF_OUT) m->m_pkthdr.pf.statekey = NULL; /* list is sorted, if-bound states before floating ones */ |