]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
scanner: Some time units are only used in limit scope
authorPhil Sutter <phil@nwl.cc>
Fri, 30 Jul 2021 15:36:58 +0000 (17:36 +0200)
committerPhil Sutter <phil@nwl.cc>
Sun, 20 Feb 2022 00:47:07 +0000 (01:47 +0100)
'hour' and 'day' are allowed as unqualified meta expressions, so leave
them alone.

Fixes: eae2525685252 ("scanner: limit: move to own scope")
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/scanner.l

index ce78fcd6fa995e2a3a01250379df25d306705d7e..eaf5460870a0929078845eae448e7f4b78e1fd65 100644 (file)
@@ -385,6 +385,11 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
 <SCANSTATE_LIMIT>{
        "rate"                  { return RATE; }
        "burst"                 { return BURST; }
+
+       /* time_unit */
+       "second"                { return SECOND; }
+       "minute"                { return MINUTE; }
+       "week"                  { return WEEK; }
 }
 <SCANSTATE_CT,SCANSTATE_LIMIT,SCANSTATE_QUOTA>"over"           { return OVER; }
 
@@ -394,11 +399,8 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
        "until"         { return UNTIL; }
 }
 
-"second"               { return SECOND; }
-"minute"               { return MINUTE; }
 "hour"                 { return HOUR; }
 "day"                  { return DAY; }
-"week"                 { return WEEK; }
 
 "reject"               { return _REJECT; }
 "with"                 { return WITH; }