[Bug 1214] Allow limit to use any value for time unit

bugzilla-daemon at netfilter.org bugzilla-daemon at netfilter.org
Mon Jan 22 12:23:02 CET 2018


https://bugzilla.netfilter.org/show_bug.cgi?id=1214

--- Comment #9 from Cyril <boite.pour.spam at gmail.com> ---
Yes, that seems more logical. I assume that not using a "value before unit"
means 1 for that unit and is not an error.

So I intend to do the following: 
1. Revert to master's state
2. Add a new rule in Bison to accept "NUM SLASH NUM TIME_UNIT"
3. Change the code in statement.c to print it correctly (as you said, I made a
mistake in the worst case length, and add some comment to justify it)

However, I'm not sure what's the best way for the following:
1. Modify the time_unit_parse to accept a value before the unit itself 
and/or
2. Rename it "time_parse" since it's parsing both time & unit
or
3. Modify the upper function ("rate_parse" something, IDRC) to parse the value
and keep the time_unit_parse as-is (but that imply "3 week" and not "3 weeks"
in the textual version of the rule)
or
4. Reject any specification that's not "value unit" thus let all bisons rules
merge into a single one "NUM STRING" and parse it to accept "345k/3week" as
well as "12/hour" or "3/900second" and so on. This however will likely require
large modification to bison's rules since STRING is a "default" case, so I need
to remove "hour/week/month/second" to avoid failing the grammar. 

I'm not sure about the test itself and the debug-netlink stuff. I'll try to
hack around but I'll need guidance about it if I don't succeed implementing it.

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20180122/ffc1f7b4/attachment.html>


More information about the netfilter-buglog mailing list