| 1561 | } |
| 1562 | |
| 1563 | int |
| 1564 | pfr_ina_rollback(struct pfr_table *trs, u_int32_t ticket, int *ndel, int flags) |
| 1565 | { |
| 1566 | struct pfr_ktableworkq workq; |
| 1567 | struct pfr_ktable *p; |
| 1568 | struct pf_kruleset *rs; |
| 1569 | int xdel = 0; |
| 1570 | |
| 1571 | PF_RULES_WASSERT(); |
| 1572 | |
| 1573 | ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY); |
| 1574 | rs = pf_find_kruleset(trs->pfrt_anchor); |
| 1575 | if (rs == NULL || !rs->topen || ticket != rs->tticket) |
| 1576 | return (0); |
| 1577 | SLIST_INIT(&workq); |
| 1578 | RB_FOREACH(p, pfr_ktablehead, &V_pfr_ktables) { |
| 1579 | if (!(p->pfrkt_flags & PFR_TFLAG_INACTIVE) || |
| 1580 | pfr_skip_table(trs, p, 0)) |
| 1581 | continue; |
| 1582 | p->pfrkt_nflags = p->pfrkt_flags & ~PFR_TFLAG_INACTIVE; |
| 1583 | SLIST_INSERT_HEAD(&workq, p, pfrkt_workq); |
| 1584 | xdel++; |
| 1585 | } |
| 1586 | if (!(flags & PFR_FLAG_DUMMY)) { |
| 1587 | pfr_setflags_ktables(&workq); |
| 1588 | rs->topen = 0; |
| 1589 | pf_remove_if_empty_kruleset(rs); |
| 1590 | } |
| 1591 | if (ndel != NULL) |
| 1592 | *ndel = xdel; |
| 1593 | return (0); |
| 1594 | } |
| 1595 | |
| 1596 | int |
| 1597 | pfr_ina_commit(struct pfr_table *trs, u_int32_t ticket, int *nadd, |
no test coverage detected