Skip to contentSkip to conversation

src: Remove expire information from list stateless ruleset.

PATCH Applied Varsha Rao 2 participants 2 messages Jun 6, 2017 netfilter

lore
Share & tools
lore

Varsha Rao

author
#0 lore raw

PATCH 1/1 src: Remove expire information from list stateless ruleset.

As expires is stateful information. This patch removes expire information from list stateless ruleset. With nft -s option, the ruleset will be as following.

table ip firewall {
        set host {
                type ipv4_addr
                flags timeout
                elements = { 10.0.0.2 timeout 10m }
        }
}
---
 src/expression.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/expression.c +1 -1
index 55dd391..4fef830 100644
@@ -962,7 +962,7 @@ static void set_elem_expr_print(const struct expr *expr)
 		printf(" timeout ");
 		time_print(expr->timeout / 1000);
 	}
-	if (expr->expiration) {
+	if (!stateless_output && expr->expiration) {
 		printf(" expires ");
 		time_print(expr->expiration / 1000);
 	}
Signature · 1 line
2.9.4
maintainer Applied
#1 lore raw
Quoted 11 lines · Varsha Rao

As expires is stateful information. This patch removes expire information from list stateless ruleset. With nft -s option, the ruleset will be as following.

table ip firewall {
        set host {
                type ipv4_addr
                flags timeout
                elements = { 10.0.0.2 timeout 10m }
        }
}

Applied, thanks Varsha.

Congrats, your first patch to nftables is in.