diff --git a/sys/net/debugnet.c b/sys/net/debugnet.c index fa8d64ab86c..a197017c176 100644 --- a/sys/net/debugnet.c +++ b/sys/net/debugnet.c @@ -523,7 +523,7 @@ debugnet_handle_udp(struct debugnet_pcb *pcb, struct mbuf **mb) * m an mbuf containing the packet received */ static void -debugnet_pkt_in(struct ifnet *ifp, struct mbuf *m) +debugnet_input_one(struct ifnet *ifp, struct mbuf *m) { struct ifreq ifr; struct ether_header *eh; @@ -582,6 +582,19 @@ done: m_freem(m); } +static void +debugnet_input(struct ifnet *ifp, struct mbuf *m) +{ + struct mbuf *n; + + do { + n = m->m_nextpkt; + m->m_nextpkt = NULL; + debugnet_input_one(ifp, m); + m = n; + } while (m != NULL); +} + /* * Network polling primitive. * @@ -736,13 +749,13 @@ debugnet_connect(const struct debugnet_conn_params *dcp, /* * We maintain the invariant that g_debugnet_pcb_inuse is always true * while the debugnet ifp's if_input is overridden with - * debugnet_pkt_in. + * debugnet_input(). */ g_debugnet_pcb_inuse = true; /* Make the card use *our* receive callback. */ pcb->dp_drv_input = ifp->if_input; - ifp->if_input = debugnet_pkt_in; + ifp->if_input = debugnet_input; printf("%s: searching for %s MAC...\n", __func__, (dcp->dc_gateway == INADDR_ANY) ? "server" : "gateway");