Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0600615

Browse files
ummakynesgregkh
authored andcommittedDec 2, 2022
netfilter: nf_tables: do not set up extensions for end interval
[ Upstream commit 33c7aba ] Elements with an end interval flag set on do not store extensions. The global set definition is currently setting on the timeout and stateful expression for end interval elements. This leads to skipping end interval elements from the set->ops->walk() path as the expired check bogusly reports true. Moreover, do not set up stateful expressions for elements with end interval flag set on since this is never used. Fixes: 6503842 ("netfilter: nf_tables: allow to specify stateful expression in set definition") Fixes: 8d8540c ("netfilter: nft_set_rbtree: add timeout support") Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 6038773 commit 0600615

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎net/netfilter/nf_tables_api.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5813,7 +5813,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
58135813
&timeout);
58145814
if (err)
58155815
return err;
5816-
} else if (set->flags & NFT_SET_TIMEOUT) {
5816+
} else if (set->flags & NFT_SET_TIMEOUT &&
5817+
!(flags & NFT_SET_ELEM_INTERVAL_END)) {
58175818
timeout = set->timeout;
58185819
}
58195820

@@ -5879,7 +5880,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
58795880
err = -EOPNOTSUPP;
58805881
goto err_set_elem_expr;
58815882
}
5882-
} else if (set->num_exprs > 0) {
5883+
} else if (set->num_exprs > 0 &&
5884+
!(flags & NFT_SET_ELEM_INTERVAL_END)) {
58835885
err = nft_set_elem_expr_clone(ctx, set, expr_array);
58845886
if (err < 0)
58855887
goto err_set_elem_expr_clone;

0 commit comments

Comments
 (0)