diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 18 | ||||
-rw-r--r-- | sys/sys/mbuf.h | 4 |
2 files changed, 14 insertions, 8 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index fb481c133f1..3e3a975c8f3 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.178 2014/01/19 03:04:54 claudio Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.179 2014/03/27 10:30:58 mpi Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -402,15 +402,18 @@ void m_cluncount(struct mbuf *m, int all) { struct mbuf_ext *me; + struct ifnet *ifp; do { me = &m->m_ext; if (((m->m_flags & (M_EXT|M_CLUSTER)) != (M_EXT|M_CLUSTER)) || - (me->ext_ifp == NULL)) + (me->ext_ifidx == 0)) continue; - me->ext_ifp->if_data.ifi_mclpool[me->ext_backend].mcl_alive--; - me->ext_ifp = NULL; + ifp = if_get(me->ext_ifidx); + if (ifp != NULL) + ifp->if_data.ifi_mclpool[me->ext_backend].mcl_alive--; + me->ext_ifidx = 0; } while (all && (m = m->m_next)); } @@ -460,7 +463,10 @@ m_clget(struct mbuf *m, int how, struct ifnet *ifp, u_int pktlen) m->m_ext.ext_free = NULL; m->m_ext.ext_arg = NULL; m->m_ext.ext_backend = pi; - m->m_ext.ext_ifp = ifp; + if (ifp != NULL) + m->m_ext.ext_ifidx = ifp->if_index; + else + m->m_ext.ext_ifidx = 0; MCLINITREFERENCE(m); return (m); } @@ -1375,7 +1381,7 @@ m_print(void *v, m->m_ext.ext_buf, m->m_ext.ext_size); (*pr)("m_ext.ext_type: %x\tm_ext.ext_backend: %i\n", m->m_ext.ext_type, m->m_ext.ext_backend); - (*pr)("m_ext.ext_ifp: %p\n", m->m_ext.ext_ifp); + (*pr)("m_ext.ext_ifidx: %u\n", m->m_ext.ext_ifidx); (*pr)("m_ext.ext_free: %p\tm_ext.ext_arg: %p\n", m->m_ext.ext_free, m->m_ext.ext_arg); (*pr)("m_ext.ext_nextref: %p\tm_ext.ext_prevref: %p\n", diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 471f7bb7a35..dfcd4ecfd65 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mbuf.h,v 1.173 2014/03/19 10:09:20 mpi Exp $ */ +/* $OpenBSD: mbuf.h,v 1.174 2014/03/27 10:30:58 mpi Exp $ */ /* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */ /* @@ -130,7 +130,7 @@ struct mbuf_ext { void *ext_arg; /* argument for ext_free */ u_int ext_size; /* size of buffer, for ext_free */ int ext_type; - struct ifnet* ext_ifp; + u_short ext_ifidx; /* index of the interface */ int ext_backend; /* backend pool the storage came from */ struct mbuf *ext_nextref; struct mbuf *ext_prevref; |