ruleset: emit time ranges when both start and stop times are specified
authorJo-Philipp Wich <jo@mein.io>
Mon, 30 May 2022 21:46:48 +0000 (23:46 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 30 May 2022 21:46:48 +0000 (23:46 +0200)
commit221040ee1c197fde7460bf16723058e0d09d707a
tree08a4cdef0c65a08334ba40dbbce12523e56b67a8
parent30a7d47039cf2cee419a48c0dfa02303f94c30c4
ruleset: emit time ranges when both start and stop times are specified

Instead of emitting two time matches checking the start and stop time/hour
respectively, emit a range when both are given. This also properly deals
with time of day ranges where start > stop since nft will take care of
implicitly inverting those.

Also add basic test coverage for time related matches.

Fixes: #9923
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/firewall4/templates/redirect.uc
root/usr/share/firewall4/templates/rule.uc
tests/03_rules/09_time [new file with mode: 0644]