diff options
Diffstat (limited to 'sys/netinet/ip_dummynet.c')
-rw-r--r-- | sys/netinet/ip_dummynet.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index c86a0524adc5..5f8c091d5cd7 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -312,7 +312,16 @@ transmit_event(struct dn_pipe *pipe) #ifdef BRIDGE case DN_TO_BDG_FWD : { struct mbuf *m = (struct mbuf *)pkt ; - bdg_forward(&m, pkt->ifp); + struct ether_header hdr; + + if (m->m_len < ETHER_HDR_LEN + && (m = m_pullup(m, ETHER_HDR_LEN)) == NULL) { + m_freem(m); + break; + } + bcopy(mtod(m, struct ether_header *), &hdr, ETHER_HDR_LEN); + m_adj(m, ETHER_HDR_LEN); + bdg_forward(&m, &hdr, pkt->ifp); if (m) m_freem(m); } |