| 636 | } |
| 637 | |
| 638 | static int |
| 639 | pf_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 | |
| 667 | static int |
| 668 | pf_rollback_altq(u_int32_t ticket) |
no test coverage detected