? dumbridgeMFC.diff Index: net/bridge.c =================================================================== RCS file: /home/ncvs/src/sys/net/bridge.c,v retrieving revision 1.16.2.6 diff -u -r1.16.2.6 bridge.c --- net/bridge.c 2000/09/25 17:30:01 1.16.2.6 +++ net/bridge.c 2000/11/25 19:06:30 @@ -625,8 +625,14 @@ if (dst == BDG_DROP) { /* this should not happen */ printf("xx bdg_forward for BDG_DROP\n"); - m_freem(*m0) ; - *m0 = NULL ; +#ifdef DUMMYNET + if ((*m0)->m_type == MT_DUMMYNET) + /* XXX: Shouldn't have to be doing this. */ + m_freem((*m0)->m_next); + else +#endif + m_freem(*m0); + *m0 = NULL; return 0; } if (dst == BDG_LOCAL) { /* this should not happen as well */ @@ -752,7 +758,15 @@ /* * pass the pkt to dummynet. Need to include m, dst, rule. * Dummynet consumes the packet in all cases. + * Also need to prepend the ethernet header. */ + M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); + if (m == NULL) { + if (canfree) + *m0 = NULL; + return ENOBUFS; + } + bcopy(eh, mtod(m, struct ether_header *), ETHER_HDR_LEN); dummynet_io((off & 0xffff), DN_TO_BDG_FWD, m, dst, NULL, 0, rule, 0); if (canfree) /* dummynet has consumed the original one */ *m0 = NULL ; Index: netinet/ip_dummynet.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_dummynet.c,v retrieving revision 1.24.2.4 diff -u -r1.24.2.4 ip_dummynet.c --- netinet/ip_dummynet.c 2000/07/17 20:06:16 1.24.2.4 +++ netinet/ip_dummynet.c 2000/11/25 19:06:35 @@ -404,13 +404,13 @@ struct mbuf *m = (struct mbuf *)pkt ; struct ether_header hdr; - if (m->m_len < ETHER_HDR_LEN - && (m = m_pullup(m, ETHER_HDR_LEN)) == NULL) { - m_freem(m); + if (pkt->dn_m->m_len < ETHER_HDR_LEN + && (pkt->dn_m = m_pullup(pkt->dn_m, ETHER_HDR_LEN)) == NULL) { + m_freem(pkt->dn_m); break; } - bcopy(mtod(m, struct ether_header *), &hdr, ETHER_HDR_LEN); - m_adj(m, ETHER_HDR_LEN); + bcopy(mtod(pkt->dn_m, struct ether_header *), &hdr, ETHER_HDR_LEN); + m_adj(pkt->dn_m, ETHER_HDR_LEN); bdg_forward(&m, &hdr, pkt->ifp); if (m) m_freem(m);