summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf.c
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2008-11-26 22:32:07 +0000
committerzec <zec@FreeBSD.org>2008-11-26 22:32:07 +0000
commit95a15f5c8435d206ae030c1ed698f4fca6afdeae (patch)
tree92dfba43d59635c80de0299501512e8472dbe130 /sys/net/bpf.c
parent7beb3e535d23cc0fe9278167a9c3dc67220250fd (diff)
downloadFreeBSD-src-95a15f5c8435d206ae030c1ed698f4fca6afdeae.zip
FreeBSD-src-95a15f5c8435d206ae030c1ed698f4fca6afdeae.tar.gz
Merge more of currently non-functional (i.e. resolving to
whitespace) macros from p4/vimage branch. Do a better job at enclosing all instantiations of globals scheduled for virtualization in #ifdef VIMAGE_GLOBALS blocks. De-virtualize and mark as const saorder_state_alive and saorder_state_any arrays from ipsec code, given that they are never updated at runtime, so virtualizing them would be pointless. Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
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