MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pf_disable_altq

Function pf_disable_altq

freebsd/netpfil/pf/pf_ioctl.c:777–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777static int
778pf_disable_altq(struct pf_altq *altq)
779{
780 struct ifnet *ifp;
781 struct tb_profile tb;
782 int error;
783
784 if ((ifp = ifunit(altq->ifname)) == NULL)
785 return (EINVAL);
786
787 /*
788 * when the discipline is no longer referenced, it was overridden
789 * by a new one. if so, just return.
790 */
791 if (altq->altq_disc != ifp->if_snd.altq_disc)
792 return (0);
793
794 error = altq_disable(&ifp->if_snd);
795
796 if (error == 0) {
797 /* clear tokenbucket regulator */
798 tb.rate = 0;
799 error = tbr_set(&ifp->if_snd, &tb);
800 }
801
802 return (error);
803}
804
805static int
806pf_altq_ifnet_event_add(struct ifnet *ifp, int remove, u_int32_t ticket,

Callers 2

pf_commit_altqFunction · 0.85
pfioctlFunction · 0.85

Calls 3

ifunitFunction · 0.85
altq_disableFunction · 0.85
tbr_setFunction · 0.85

Tested by

no test coverage detected