bpf_attachd(d, bp);
bpf_attachd(d, candidate);
bpf_setif(d, ifr)	struct bpf_d *d;	struct ifreq *ifr;{	struct bpf_if *bp;	int s, error;	/*	 * Look through attached interfaces for the named one.	 */	for (bp = bpf_iflist; bp != 0; bp = bp->bif_next) {		struct ifnet *ifp = bp->bif_ifp;		if (ifp == 0 ||		    strcmp(ifp->if_xname, ifr->ifr_name) != 0)			continue;		/*		 * We found the requested interface.		 * Allocate the packet buffers if we need to.		 * If we're already attached to requested interface,		 * just flush the buffer.		 */		if (d->bd_sbuf == 0) {			error = bpf_allocbufs(d);			if (error != 0)				return (error);		}		s = splimp();		if (bp != d->bd_bif) {			if (d->bd_bif)				/*				 * Detach if attached to something else.				 */				bpf_detachd(d);			bpf_attachd(d, bp);		}		bpf_reset_d(d);		splx(s);		return (0);	}	/* Not found. */	return (ENXIO);}