summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/net/bpf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 728bac2..506d15f 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -144,7 +144,6 @@ static d_kqfilter_t bpfkqfilter;
static struct cdevsw bpf_cdevsw = {
.d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
.d_open = bpfopen,
.d_close = bpfclose,
.d_read = bpfread,
@@ -775,8 +774,10 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
if (d->bd_bif == NULL)
error = EINVAL;
else {
+ NET_LOCK_GIANT();
ifp = d->bd_bif->bif_ifp;
error = (*ifp->if_ioctl)(ifp, cmd, addr);
+ NET_UNLOCK_GIANT();
}
break;
}
@@ -834,9 +835,9 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
break;
}
if (d->bd_promisc == 0) {
- mtx_lock(&Giant);
+ NET_LOCK_GIANT();
error = ifpromisc(d->bd_bif->bif_ifp, 1);
- mtx_unlock(&Giant);
+ NET_UNLOCK_GIANT();
if (error == 0)
d->bd_promisc = 1;
}
OpenPOWER on IntegriCloud