Skip to content

Commit 28adabf

Browse files
ummakynesgregkh
authored andcommitted
netfilter: nft_dynset: add timeout extension to template
commit 0c5b7a5 upstream. Otherwise, the newly create element shows no timeout when listing the ruleset. If the set definition does not specify a default timeout, then the set element only shows the expiration time, but not the timeout. This is a problem when restoring a stateful ruleset listing since it skips the timeout policy entirely. Fixes: 22fe54d ("netfilter: nf_tables: add support for dynamic set updates") Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fec7ae2 commit 28adabf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/netfilter/nft_dynset.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,10 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
204204
nft_set_ext_add_length(&priv->tmpl, NFT_SET_EXT_EXPR,
205205
priv->expr->ops->size);
206206
if (set->flags & NFT_SET_TIMEOUT) {
207-
if (timeout || set->timeout)
207+
if (timeout || set->timeout) {
208+
nft_set_ext_add(&priv->tmpl, NFT_SET_EXT_TIMEOUT);
208209
nft_set_ext_add(&priv->tmpl, NFT_SET_EXT_EXPIRATION);
210+
}
209211
}
210212

211213
priv->timeout = timeout;

0 commit comments

Comments
 (0)