Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jul 2016 14:26:18 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-pf@FreeBSD.org
Subject:   [Bug 210924] 10.3-STABLE - PF - possible regression in pf.conf set timeout interval
Message-ID:  <bug-210924-17777-CVVUXuRHa5@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-210924-17777@https.bugs.freebsd.org/bugzilla/>
References:  <bug-210924-17777@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210924

--- Comment #3 from Kristof Provost <kp@freebsd.org> ---
It's probably a little too late to get away with changing the altq keywords.
This has hit 10.3 (and soon 11.0).

It should be possible to teach pfctl that both 'set timeout interval 10' and
the new interval option are valid.

I'm not really good with yacc, but this seems to work, even if it looks a
little ugly:
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index e0cfa3d..9457a5b 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -4460,6 +4460,19 @@ timeout_spec     : STRING NUMBER
                        }
                        free($1);
                }
+               | INTERVAL NUMBER
+               {
+                       if (check_rulestate(PFCTL_STATE_OPTION)) {
+                               YYERROR;
+                       }
+                       if ($2 < 0 || $2 > UINT_MAX) {
+                               yyerror("only positive values permitted");
+                               YYERROR;
+                       }
+                       if (pfctl_set_timeout(pf, "interval", $2, 0) !=3D 0=
) {
+                               YYERROR;
+                       }
+               }
                ;

 timeout_list   : timeout_list comma timeout_spec optnl

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-210924-17777-CVVUXuRHa5>