Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107126223
D42467.id129748.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
888 B
Referenced Files
None
Subscribers
None
D42467.id129748.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D42467: if_tuntap: trigger the bpf hook on transmitting for the tap interface
Attached
Detach File
Event Timeline
Log In to Comment