summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorAlexandr Nedvedicky <sashan@cvs.openbsd.org>2015-12-22 13:33:27 +0000
committerAlexandr Nedvedicky <sashan@cvs.openbsd.org>2015-12-22 13:33:27 +0000
commit6f84eb405105f5d7223bd9faf601ce3089e40530 (patch)
treec3d86e39a149a0c655797046b37607cfd15fcefe /sys/kern
parent742d7bc139472656d92ffbbe340cb1939560dd81 (diff)
- 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@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_mbuf.c17
1 files changed, 15 insertions, 2 deletions
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 <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@@ -85,6 +87,9 @@
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <net/if.h>
+#if NPF > 0
+#include <net/pfvar.h>
+#endif /* NPF > 0 */
#include <uvm/uvm_extern.h>
@@ -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);