Don't require a device to be marked up when issuing BIOCSETIF.

This commit is contained in:
Sam Leffler 2004-12-08 05:40:02 +00:00
parent 1c4dbedac4
commit 3518d22073
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=138540

View File

@ -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)