From: Kevin Darbyshire-Bryant Date: Sat, 14 Aug 2021 05:54:13 +0000 (+0100) Subject: ipsets: permit default timeout of 0 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=40e5f6a2bd0b5406eff7e1d2d4f95bbf8f9410a4;p=project%2Ffirewall3.git ipsets: permit default timeout of 0 Allow ipsets to be created with a default timeout of 0. This permits timed entries to be added if required even though the default is 0 (indefinite) Prior to this change a default timeout value of 0 would create a set without timeout support. Fixes: FS#3977 Signed-off-by: Kevin Darbyshire-Bryant --- diff --git a/ipsets.c b/ipsets.c index ba31e64..e7cde16 100644 --- a/ipsets.c +++ b/ipsets.c @@ -266,6 +266,7 @@ fw3_alloc_ipset(struct fw3_state *state) ipset->enabled = true; ipset->family = FW3_FAMILY_V4; ipset->reload_set = false; + ipset->timeout = -1; /* no timeout by default */ list_add_tail(&ipset->list, &state->ipsets); @@ -395,7 +396,7 @@ create_ipset(struct fw3_ipset *ipset, struct fw3_state *state) ipset->portrange.port_min, ipset->portrange.port_max); } - if (ipset->timeout > 0) + if (ipset->timeout >= 0) fw3_pr(" timeout %u", ipset->timeout); if (ipset->maxelem > 0)