]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pfctl: delay label macro expansion until after rule optimisation
authorKristof Provost <kp@FreeBSD.org>
Wed, 13 Oct 2021 14:06:47 +0000 (16:06 +0200)
committerKristof Provost <kp@FreeBSD.org>
Fri, 15 Oct 2021 20:19:45 +0000 (22:19 +0200)
commit09c7f2386973f8c36978895a7600320916bc3d07
tree47e7e3d5420c1ae11df2800f4fad9164728e3506
parent77c595ce33a37d321ef35fd840948a2e5fd17c84
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
sbin/pfctl/parse.y
sbin/pfctl/pfctl.c
sbin/pfctl/pfctl.h