summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian S.J. Peron <csjp@FreeBSD.org>2007-06-15 02:53:51 +0000
committerChristian S.J. Peron <csjp@FreeBSD.org>2007-06-15 02:53:51 +0000
commit5632c9822aa98448156f531fc76b3fb8cfbcee76 (patch)
treead8469ac2968f9e92df0c7506f3b7de5df4437af
parent629b8f3e0fad4abda91a9519d7db1d6765b97bd4 (diff)
Notes
-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 728bac27356a..506d15f7faff 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;
}