aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2006-02-09 16:59:37 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2006-02-09 16:59:37 +0000
commit55d6ab05352b64004f8bc8f8f8d66d4f726a7e2d (patch)
tree6997e21ae601414f74e7d5924e7e86f0a7df27eb /sys
parentdad24db7d44086447192532340091173fc244acb (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/netgraph/ng_eiface.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c
index f834d3072c02..3ecda10c08ed 100644
--- a/sys/netgraph/ng_eiface.c
+++ b/sys/netgraph/ng_eiface.c
@@ -217,43 +217,37 @@ ng_eiface_start2(node_p node, hook_p hook, void *arg1, int arg2)
(ifp->if_drv_flags & IFF_DRV_RUNNING)))
return;
- /* Don't do anything if output is active */
- if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
- return;
-
- ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-
- /*
- * Grab a packet to transmit.
- */
- IF_DEQUEUE(&ifp->if_snd, m);
+ for (;;) {
+ /*
+ * Grab a packet to transmit.
+ */
+ IF_DEQUEUE(&ifp->if_snd, m);
- /* If there's nothing to send, return. */
- if (m == NULL) {
- ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- return;
- }
+ /* If there's nothing to send, break. */
+ if (m == NULL)
+ break;
- /*
- * Berkeley packet filter.
- * Pass packet to bpf if there is a listener.
- * XXX is this safe? locking?
- */
- BPF_MTAP(ifp, m);
+ /*
+ * Berkeley packet filter.
+ * Pass packet to bpf if there is a listener.
+ * XXX is this safe? locking?
+ */
+ BPF_MTAP(ifp, m);
- /* Copy length before the mbuf gets invalidated */
- len = m->m_pkthdr.len;
+ /* Copy length before the mbuf gets invalidated */
+ len = m->m_pkthdr.len;
- /*
- * Send packet; if hook is not connected, mbuf will get
- * freed.
- */
- NG_SEND_DATA_ONLY(error, priv->ether, m);
+ /*
+ * Send packet; if hook is not connected, mbuf will get
+ * freed.
+ */
+ NG_SEND_DATA_ONLY(error, priv->ether, m);
- /* Update stats */
- if (error == 0) {
- ifp->if_obytes += len;
- ifp->if_opackets++;
+ /* Update stats */
+ if (error == 0) {
+ ifp->if_obytes += len;
+ ifp->if_opackets++;
+ }
}
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
@@ -280,6 +274,12 @@ ng_eiface_start(struct ifnet *ifp)
const priv_p priv = (priv_p)ifp->if_softc;
+ /* Don't do anything if output is active */
+ if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
+ return;
+
+ ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+
ng_send_fn(priv->node, NULL, &ng_eiface_start2, ifp, 0);
}