HomeFreeBSD

pfctl: delay label macro expansion until after rule optimisation

Description

pfctl: delay label macro expansion until after rule optimisation

We used to expand the $nr macro in labels into the rule number prior to
the optimisation step. This would occasionally produce incorrect rule
numbers in the labels.

Delay all macro expansion until after the optimisation step to ensure
that we expand the correct values.

MFC after: 1 week
Reported by: Özkan KIRIK <ozkan.kirik@gmail.com>
Differential Revision: https://reviews.freebsd.org/D32488

(cherry picked from commit 09c7f2386973f8c36978895a7600320916bc3d07)

Details

Provenance
kpAuthored on Oct 13 2021, 2:06 PM
Differential Revision
D32488: pfctl: delay label macro expansion until after rule optimisation
Parents
rG006fadf8347b: pf: do not copy anchor_wildcard / anchor_relative from userspace
Branches
Unknown
Tags
Unknown