Page MenuHomeFreeBSD

D42467.id129748.diff
No OneTemporary

D42467.id129748.diff

diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c
--- a/sys/net/if_tuntap.c
+++ b/sys/net/if_tuntap.c
@@ -933,6 +933,16 @@
TUN_UNLOCK(tp);
} /* tunstart_l2 */
+static int
+tap_transmit(struct ifnet *ifp, struct mbuf *m)
+{
+ int error;
+
+ BPF_MTAP(ifp, m);
+ IFQ_HANDOFF(ifp, m, error);
+ return (error);
+}
+
/* XXX: should return an error code so it can fail. */
static void
tuncreate(struct cdev *dev)
@@ -972,6 +982,8 @@
if ((tp->tun_flags & TUN_L2) != 0) {
ifp->if_init = tunifinit;
ifp->if_start = tunstart_l2;
+ ifp->if_transmit = tap_transmit;
+ ifp->if_qflush = if_qflush;
ether_gen_addr(ifp, &eaddr);
ether_ifattach(ifp, eaddr.octet);
@@ -1713,9 +1725,6 @@
}
TUN_UNLOCK(tp);
- if ((tp->tun_flags & TUN_L2) != 0)
- BPF_MTAP(ifp, m);
-
len = min(tp->tun_vhdrlen, uio->uio_resid);
if (len > 0) {
struct virtio_net_hdr_mrg_rxbuf vhdr;

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 11, 12:51 PM (8 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15752122
Default Alt Text
D42467.id129748.diff (888 B)

Event Timeline