From 6f84eb405105f5d7223bd9faf601ce3089e40530 Mon Sep 17 00:00:00 2001 From: Alexandr Nedvedicky Date: Tue, 22 Dec 2015 13:33:27 +0000 Subject: - yet another tiny step towards MP PF. This time we need to make sure statekey attached to packet stays around, while accepted packet is routed through IP stack. OK mpi@, henning@ --- sys/kern/uipc_mbuf.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index dbf61b6ed8e..c260aa819ac 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.214 2015/11/21 11:46:24 mpi Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.215 2015/12/22 13:33:26 sashan Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -72,6 +72,8 @@ * Research Laboratory (NRL). */ +#include "pf.h" + #include #include #include @@ -85,6 +87,9 @@ #include #include #include +#if NPF > 0 +#include +#endif /* NPF > 0 */ #include @@ -261,6 +266,10 @@ m_resethdr(struct mbuf *m) /* delete all mbuf tags to reset the state */ m_tag_delete_chain(m); +#if NPF > 0 + pf_pkt_unlink_state_key(m); +#endif /* NPF > 0 */ + /* like m_inithdr(), but keep any associated data and mbufs */ memset(&m->m_pkthdr, 0, sizeof(m->m_pkthdr)); m->m_pkthdr.pf.prio = IFQ_DEFPRIO; @@ -350,8 +359,12 @@ m_free(struct mbuf *m) if (n) n->m_flags |= M_ZEROIZE; } - if (m->m_flags & M_PKTHDR) + if (m->m_flags & M_PKTHDR) { m_tag_delete_chain(m); +#if NPF > 0 + pf_pkt_unlink_state_key(m); +#endif /* NPF > 0 */ + } if (m->m_flags & M_EXT) m_extfree(m); -- cgit v1.2.3