usr/src/sys/altq/altq_subr.c
/*
 * detach a discipline from the interface.
 * it is possible that the discipline was already overridden by another
 * discipline.
 */
detach a discipline from the interface.
it is possible that the discipline was already overridden by another
discipline.
detach a discipline from the interface . it is possible that the discipline was already overridden by another discipline .
int
altq_pfdetach(struct pf_altq *a)
{
	struct ifnet *ifp;
	int s, error = 0;
	if ((ifp = ifunit(a->ifname)) == NULL)
		return (EINVAL);
	if (a->altq_disc == NULL || a->altq_disc != ifp->if_snd.altq_disc)
		return (0);
	s = splnet();
	if (ALTQ_IS_ENABLED(&ifp->if_snd))
		error = altq_disable(&ifp->if_snd);
	if (error == 0)
		error = altq_detach(&ifp->if_snd);
	splx(s);
	return (error);
}
int altq_pfdetach ( struct pf_altq * a ) { struct ifnet * ifp ; int s , error = 0 ; if ( ( ifp = ifunit ( a -> ifname ) ) == NULL ) return ( EINVAL ) ; if ( a -> altq_disc == NULL || a -> altq_disc != ifp -> if_snd . altq_disc ) return ( 0 ) ; s = splnet ( ) ; if ( ALTQ_IS_ENABLED ( & ifp -> if_snd ) ) error = altq_disable ( & ifp -> if_snd ) ; if ( error == 0 ) error = altq_detach ( & ifp -> if_snd ) ; splx ( s ) ; return ( error ) ; }
detach a discipline from the interface.
detach a discipline from the interface .
/* if this discipline is no longer referenced, just return */