sys/net/if_clone.c
int
if_clone_destroy(const char *name)
{
	struct if_clone *ifc;
	struct ifnet *ifp;
	int bytoff, bitoff;
	int unit, error;

	ifc = if_clone_lookup(name, &unit);
	if (ifc == NULL)
		return (EINVAL);

	if (unit < ifc->ifc_minifs)
		return (EINVAL);

	ifp = ifunit(name);
	if (ifp == NULL)
		return (ENXIO);

	if (ifc->ifc_destroy == NULL)
		return (EOPNOTSUPP);

	error = ifc->ifc_destroy(ifp);
	if (error)
		return error;

	/*
	 * Compute offset in the bitmap and deallocate the unit.
	 */
	bytoff = unit >> 3;
	bitoff = unit - (bytoff << 3);
	KASSERT((ifc->ifc_units[bytoff] & (1 << bitoff)) != 0,
	    ("%s: bit is already cleared", __func__));
	ifc->ifc_units[bytoff] &= ~(1 << bitoff);
	return (0);
}
/*
 * Destroy a clone network interface.
 */
Destroy a clone network interface.
Destroy a clone network interface .
int
if_clone_destroy(const char *name)
{
	struct if_clone *ifc;
	struct ifnet *ifp;
	int bytoff, bitoff;
	int unit, error;
	ifc = if_clone_lookup(name, &unit);
	if (ifc == NULL)
		return (EINVAL);
	if (unit < ifc->ifc_minifs)
		return (EINVAL);
	ifp = ifunit(name);
	if (ifp == NULL)
		return (ENXIO);
	if (ifc->ifc_destroy == NULL)
		return (EOPNOTSUPP);
	error = ifc->ifc_destroy(ifp);
	if (error)
		return error;
	bytoff = unit >> 3;
	bitoff = unit - (bytoff << 3);
	KASSERT((ifc->ifc_units[bytoff] & (1 << bitoff)) != 0,
	    ("%s: bit is already cleared", __func__));
	ifc->ifc_units[bytoff] &= ~(1 << bitoff);
	return (0);
}
int if_clone_destroy ( const char * name ) { struct if_clone * ifc ; struct ifnet * ifp ; int bytoff , bitoff ; int unit , error ; ifc = if_clone_lookup ( name , & unit ) ; if ( ifc == NULL ) return ( EINVAL ) ; if ( unit < ifc -> ifc_minifs ) return ( EINVAL ) ; ifp = ifunit ( name ) ; if ( ifp == NULL ) return ( ENXIO ) ; if ( ifc -> ifc_destroy == NULL ) return ( EOPNOTSUPP ) ; error = ifc -> ifc_destroy ( ifp ) ; if ( error ) return error ; bytoff = unit >> 3 ; bitoff = unit - ( bytoff << 3 ) ; KASSERT ( ( ifc -> ifc_units [ bytoff ] & ( 1 << bitoff ) ) != 0 , ( " " , __func__ ) ) ; ifc -> ifc_units [ bytoff ] &= ~ ( 1 << bitoff ) ; return ( 0 ) ; }
Destroy a clone network interface.
Destroy a clone network interface .
/*
	 * Compute offset in the bitmap and deallocate the unit.
	 */