diff --git a/sys/net/bpf.c b/sys/net/bpf.c --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1515,18 +1515,18 @@ * Put interface into promiscuous mode. */ case BIOCPROMISC: + BPF_LOCK(); if (d->bd_bif == NULL) { /* * No interface attached yet. */ error = EINVAL; - break; - } - if (d->bd_promisc == 0) { + } else if (d->bd_promisc == 0) { error = ifpromisc(d->bd_bif->bif_ifp, 1); if (error == 0) d->bd_promisc = 1; } + BPF_UNLOCK(); break; /*