src/sys/dev/virtio/network/if_vtnet.c
/*
 * The device defaults to promiscuous mode for backwards compatibility.
 * Turn it off at attach time if possible.
 */
The device defaults to promiscuous mode for backwards compatibility.
Turn it off at attach time if possible.
The device defaults to promiscuous mode for backwards compatibility . Turn it off at attach time if possible .
static void
vtnet_attach_disable_promisc(struct vtnet_softc *sc)
{
	struct ifnet *ifp;
	ifp = sc->vtnet_ifp;
	VTNET_CORE_LOCK(sc);
	if ((sc->vtnet_flags & VTNET_FLAG_CTRL_RX) == 0) {
		ifp->if_flags |= IFF_PROMISC;
	} else if (vtnet_set_promisc(sc, 0) != 0) {
		ifp->if_flags |= IFF_PROMISC;
		device_printf(sc->vtnet_dev,
		    "cannot disable default promiscuous mode\n");
	}
	VTNET_CORE_UNLOCK(sc);
}
static void vtnet_attach_disable_promisc ( struct vtnet_softc * sc ) { struct ifnet * ifp ; ifp = sc -> vtnet_ifp ; VTNET_CORE_LOCK ( sc ) ; if ( ( sc -> vtnet_flags & VTNET_FLAG_CTRL_RX ) == 0 ) { ifp -> if_flags |= IFF_PROMISC ; } else if ( vtnet_set_promisc ( sc , 0 ) != 0 ) { ifp -> if_flags |= IFF_PROMISC ; device_printf ( sc -> vtnet_dev , " \n " ) ; } VTNET_CORE_UNLOCK ( sc ) ; }
The device defaults to promiscuous mode for backwards compatibility.
The device defaults to promiscuous mode for backwards compatibility .