git: 3c87f145d4e8 - stable/13 - pfctl: fix FOM_ICMP/POM_STICKYADDRESS clash

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Sat, 20 Aug 2022 07:17:21 UTC
The branch stable/13 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=3c87f145d4e82c26b8dd73274831f9ce6a9c7a16

commit 3c87f145d4e82c26b8dd73274831f9ce6a9c7a16
Author:     Franco Fichtner <franco@opnsense.org>
AuthorDate: 2022-08-06 08:59:56 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-08-20 07:14:27 +0000

    pfctl: fix FOM_ICMP/POM_STICKYADDRESS clash
    
            pass inet proto icmp icmp-type {unreach}
            pass route-to (if0 127.0.0.1/8) sticky-address inet
    
    The wrong struct was being tested. The parser tries to prevent
    "sticky-address sticky-address" syntax but was actually cross-rule
    enforcing that ICMP filter cannot be before the use of "sticky-address"
    in next rule.
    
    MFC after:      2 weeks
    Reviewed by:    kp
    Differential Revision:  https://reviews.freebsd.org/D36050
    
    (cherry picked from commit 1e73fbd8b28946cb1341b51292082864943f0a89)
---
 sbin/pfctl/parse.y | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index eafc637951fc..e08996a54250 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -4083,7 +4083,7 @@ pool_opt	: BITMASK	{
 			pool_opts.staticport = 1;
 		}
 		| STICKYADDRESS	{
-			if (filter_opts.marker & POM_STICKYADDRESS) {
+			if (pool_opts.marker & POM_STICKYADDRESS) {
 				yyerror("sticky-address cannot be redefined");
 				YYERROR;
 			}