summaryrefslogtreecommitdiffstats
path: root/src/scanner.l
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2021-07-30 17:36:58 +0200
committerPhil Sutter <phil@nwl.cc>2022-02-20 01:47:07 +0100
commitb65ae5c1b4f74bc777eb2dc58be94dd524057683 (patch)
treeaf0f641cc9cabea9f13e19053bc975190a587607 /src/scanner.l
parent7151cadaa191d8cea3bd34938ef41d5e93d5185b (diff)
scanner: Some time units are only used in limit scope
'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>
Diffstat (limited to 'src/scanner.l')
-rw-r--r--src/scanner.l8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/scanner.l b/src/scanner.l
index ce78fcd6..eaf54608 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -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; }