diff options
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 18 |
1 files changed, 12 insertions, 6 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", |