From 6e8f58c2dd0f44864fc1a2e8dc4c18cdfa2d73af Mon Sep 17 00:00:00 2001 From: XCas13 Date: Sun, 8 Feb 2026 11:38:20 +0400 Subject: [PATCH] ruleset: fix for missing counters handling code for ipsets This commit adds missing code that handles counters for ipsets. Fixes #69 Signed-off-by: XCas13 --- root/usr/share/firewall4/templates/ruleset.uc | 3 +++ tests/05_ipsets/01_declaration | 1 + 2 files changed, 4 insertions(+) diff --git a/root/usr/share/firewall4/templates/ruleset.uc b/root/usr/share/firewall4/templates/ruleset.uc index 2bec4d9..92fea2b 100644 --- a/root/usr/share/firewall4/templates/ruleset.uc +++ b/root/usr/share/firewall4/templates/ruleset.uc @@ -61,6 +61,9 @@ table inet fw4 { {% if (set.timeout > 0): %} timeout {{ set.timeout }}s {% endif %} +{% if (set.counters): %} + counter +{% endif %} {% if (set.interval): %} auto-merge {% endif %} diff --git a/tests/05_ipsets/01_declaration b/tests/05_ipsets/01_declaration index 60c1514..4b274a6 100644 --- a/tests/05_ipsets/01_declaration +++ b/tests/05_ipsets/01_declaration @@ -57,6 +57,7 @@ table inet fw4 { type ipv4_addr . inet_service size 1000 timeout 600s + counter flags timeout elements = { 1.2.3.4 . 80,