git: d8d7bd50cb88 - main - pfctl: simplify FOM_PRIO handling

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Mon, 30 Jun 2025 09:54:39 UTC
The branch main has been updated by kp:

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

commit d8d7bd50cb887000535b9e75e2f5688b8718127f
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-06-27 09:13:17 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-06-30 07:53:56 +0000

    pfctl: simplify FOM_PRIO handling
    
    Obtained from:  OpenBSD, kn <kn@openbsd.org>, d114b77333
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sbin/pfctl/parse.y | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index df40478b0403..9d2fd35ea4ee 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -7619,12 +7619,8 @@ filteropts_to_rule(struct pfctl_rule *r, struct filter_opts *opts)
 		r->rule_flag |= PFRULE_AFTO;
 	if (opts->marker & FOM_SCRUB_TCP)
 		r->scrub_flags |= PFSTATE_SCRUB_TCP;
-	if (opts->marker & FOM_PRIO) {
-		if (opts->prio == 0)
-			r->prio = PF_PRIO_ZERO;
-		else
-			r->prio = opts->prio;
-	}
+	if (opts->marker & FOM_PRIO)
+		r->prio = opts->prio ? opts->prio : PF_PRIO_ZERO;
 	if (opts->marker & FOM_SETPRIO) {
 		r->set_prio[0] = opts->set_prio[0];
 		r->set_prio[1] = opts->set_prio[1];