diff options
author | sam <sam@FreeBSD.org> | 2004-12-08 05:40:02 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2004-12-08 05:40:02 +0000 |
commit | 051e994615fd7f1d1c92a0c735c4ae9684dec488 (patch) | |
tree | 04981e8edb2b4b776d3390ce244a45af43329cda /sys/net | |
parent | cdb92b391789367b6d389c194b0f7150be67ef2e (diff) | |
download | FreeBSD-src-051e994615fd7f1d1c92a0c735c4ae9684dec488.zip FreeBSD-src-051e994615fd7f1d1c92a0c735c4ae9684dec488.tar.gz |
Don't require a device to be marked up when issuing BIOCSETIF.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/bpf.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 118d266..1022e87 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -564,6 +564,9 @@ bpfwrite(dev, uio, ioflag) ifp = d->bd_bif->bif_ifp; + if ((ifp->if_flags & IFF_UP) == 0) + return (ENETDOWN); + if (uio->uio_resid == 0) return (0); @@ -1006,14 +1009,10 @@ bpf_setif(d, ifr) mtx_unlock(&bpf_mtx); /* * We found the requested interface. - * If it's not up, return an error. * Allocate the packet buffers if we need to. * If we're already attached to requested interface, * just flush the buffer. */ - if ((ifp->if_flags & IFF_UP) == 0) - return (ENETDOWN); - if (d->bd_sbuf == NULL) { error = bpf_allocbufs(d); if (error != 0) |