summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r--sys/net/bpf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 6eb58f7..3a7ec7f 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sockio.h>
#include <sys/ttycom.h>
#include <sys/uio.h>
+#include <sys/vimage.h>
#include <sys/event.h>
#include <sys/file.h>
@@ -566,7 +567,9 @@ bpf_detachd(struct bpf_d *d)
*/
if (d->bd_promisc) {
d->bd_promisc = 0;
+ CURVNET_SET(ifp->if_vnet);
error = ifpromisc(ifp, 0);
+ CURVNET_RESTORE();
if (error != 0 && error != ENXIO) {
/*
* ENXIO can happen if a pccard is unplugged
@@ -872,7 +875,9 @@ bpfwrite(struct cdev *dev, struct uio *uio, int ioflag)
#ifdef MAC
BPFD_LOCK(d);
+ CURVNET_SET(ifp->if_vnet);
mac_bpfdesc_create_mbuf(d, m);
+ CURVNET_RESTORE();
if (mc != NULL)
mac_bpfdesc_create_mbuf(d, mc);
BPFD_UNLOCK(d);
@@ -993,6 +998,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
return (EPERM);
}
}
+ CURVNET_SET(TD_TO_VNET(td));
switch (cmd) {
default:
@@ -1322,6 +1328,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
case BIOCROTZBUF:
return (bpf_ioctl_rotzbuf(td, d, (struct bpf_zbuf *)addr));
}
+ CURVNET_RESTORE();
return (error);
}
OpenPOWER on IntegriCloud