pfctl: parser must not ignore error from pfctl_optimize_ruleset()
Ignoring the error may cause pfctl(8) to load inconsistent ruleset
preventing pf(4) to enforce desired policy.
Issue reported and fix suggested by berts _from_ fastmail _dot_ com
'Looks good.' @deraadt
MFC after: 1 week
Obtained from: OpenBSD, sashan <sashan@openbsd.org>, 9fd28a8cca
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit 343ace42f82a629374af4dc3a72da5f46f2c3feb)
This commit is contained in:
parent
920990c75a
commit
55f031f303
1 changed files with 3 additions and 2 deletions
|
|
@ -1959,8 +1959,9 @@ pfctl_load_ruleset(struct pfctl *pf, char *path, struct pfctl_ruleset *rs,
|
|||
|
||||
}
|
||||
|
||||
if (pf->optimize && rs_num == PF_RULESET_FILTER)
|
||||
pfctl_optimize_ruleset(pf, rs);
|
||||
if (pf->optimize && rs_num == PF_RULESET_FILTER &&
|
||||
(error = pfctl_optimize_ruleset(pf, rs)) != 0)
|
||||
goto error;
|
||||
|
||||
while ((r = TAILQ_FIRST(rs->rules[rs_num].active.ptr)) != NULL) {
|
||||
TAILQ_REMOVE(rs->rules[rs_num].active.ptr, r, entries);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue