| 926 | } |
| 927 | |
| 928 | static int |
| 929 | pf_rollback_rules(u_int32_t ticket, int rs_num, char *anchor) |
| 930 | { |
| 931 | struct pf_kruleset *rs; |
| 932 | struct pf_krule *rule; |
| 933 | |
| 934 | PF_RULES_WASSERT(); |
| 935 | |
| 936 | if (rs_num < 0 || rs_num >= PF_RULESET_MAX) |
| 937 | return (EINVAL); |
| 938 | rs = pf_find_kruleset(anchor); |
| 939 | if (rs == NULL || !rs->rules[rs_num].inactive.open || |
| 940 | rs->rules[rs_num].inactive.ticket != ticket) |
| 941 | return (0); |
| 942 | while ((rule = TAILQ_FIRST(rs->rules[rs_num].inactive.ptr)) != NULL) { |
| 943 | pf_unlink_rule(rs->rules[rs_num].inactive.ptr, rule); |
| 944 | rs->rules[rs_num].inactive.rcount--; |
| 945 | } |
| 946 | rs->rules[rs_num].inactive.open = 0; |
| 947 | return (0); |
| 948 | } |
| 949 | |
| 950 | #define PF_MD5_UPD(st, elm) \ |
| 951 | MD5Update(ctx, (u_int8_t *) &(st)->elm, sizeof((st)->elm)) |
no test coverage detected