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

Function pf_begin_altq

freebsd/netpfil/pf/pf_ioctl.c:638–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636}
637
638static int
639pf_begin_altq(u_int32_t *ticket)
640{
641 struct pf_altq *altq, *tmp;
642 int error = 0;
643
644 PF_RULES_WASSERT();
645
646 /* Purge the old altq lists */
647 TAILQ_FOREACH_SAFE(altq, V_pf_altq_ifs_inactive, entries, tmp) {
648 if ((altq->local_flags & PFALTQ_FLAG_IF_REMOVED) == 0) {
649 /* detach and destroy the discipline */
650 error = altq_remove(altq);
651 }
652 free(altq, M_PFALTQ);
653 }
654 TAILQ_INIT(V_pf_altq_ifs_inactive);
655 TAILQ_FOREACH_SAFE(altq, V_pf_altqs_inactive, entries, tmp) {
656 pf_qid_unref(altq->qid);
657 free(altq, M_PFALTQ);
658 }
659 TAILQ_INIT(V_pf_altqs_inactive);
660 if (error)
661 return (error);
662 *ticket = ++V_ticket_altqs_inactive;
663 V_altqs_inactive_open = 1;
664 return (0);
665}
666
667static int
668pf_rollback_altq(u_int32_t ticket)

Callers 3

pf_altq_ifnet_eventFunction · 0.85
pfioctlFunction · 0.85
shutdown_pfFunction · 0.85

Calls 3

altq_removeFunction · 0.85
pf_qid_unrefFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected