-/* $OpenBSD: pf_ioctl.c,v 1.376 2022/04/04 12:57:36 sashan Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.377 2022/04/07 14:13:01 mbuhl Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
int pfclose(dev_t, int, int, struct proc *);
int pfioctl(dev_t, u_long, caddr_t, int, struct proc *);
int pf_begin_rules(u_int32_t *, const char *);
-int pf_rollback_rules(u_int32_t, char *);
+void pf_rollback_rules(u_int32_t, char *);
void pf_remove_queues(void);
int pf_commit_queues(void);
void pf_free_queues(struct pf_queuehead *);
return (0);
}
-int
+void
pf_rollback_rules(u_int32_t ticket, char *anchor)
{
struct pf_ruleset *rs;
rs = pf_find_ruleset(anchor);
if (rs == NULL || !rs->rules.inactive.open ||
rs->rules.inactive.ticket != ticket)
- return (0);
+ return;
while ((rule = TAILQ_FIRST(rs->rules.inactive.ptr)) != NULL) {
pf_rm_rule(rs->rules.inactive.ptr, rule);
rs->rules.inactive.rcount--;
/* queue defs only in the main ruleset */
if (anchor[0])
- return (0);
+ return;
pf_free_queues(pf_queues_inactive);
-
- return (0);
}
void
}
break;
case PF_TRANS_RULESET:
- if ((error = pf_rollback_rules(ioe->ticket,
- ioe->anchor))) {
- PF_UNLOCK();
- NET_UNLOCK();
- free(table, M_TEMP, sizeof(*table));
- free(ioe, M_TEMP, sizeof(*ioe));
- goto fail; /* really bad */
- }
+ pf_rollback_rules(ioe->ticket, ioe->anchor);
break;
default:
PF_UNLOCK();