From 35d4f97c3476bf03e6d4bacd50f48c502ddf4107 Mon Sep 17 00:00:00 2001 From: loos Date: Tue, 9 Aug 2016 03:47:38 +0000 Subject: [PATCH] MFC r303760: Fix a regression in pf.conf while parsing the 'interval' keyword. The bug was introduced by r287009. PR: 210924 Submitted by: kp@ Sponsored by: Rubicon Communications (Netgate) git-svn-id: svn://svn.freebsd.org/base/stable/10@303865 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sbin/pfctl/parse.y | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index b0aa62298..56ccd1101 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -4384,6 +4384,16 @@ 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) != 0) + YYERROR; + } ; timeout_list : timeout_list comma timeout_spec optnl -- 2.45.0