From fbae632804554aa39abb8f76fbca5935cdd7e620 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 5 Dec 2019 19:07:16 +0100 Subject: segtree: don't remove nul-root element from interval set Check from the delinearize set element path if the nul-root element already exists in the interval set. Hence, the element insertion path skips the implicit nul-root interval insertion. Under some circunstances, nft bogusly fails to delete the last element of the interval set and to create an element in an existing empty internal set. This patch includes a test that reproduces the issue. Fixes: 4935a0d561b5 ("segtree: special handling for the first non-matching segment") Signed-off-by: Pablo Neira Ayuso --- include/netlink.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/netlink.h') diff --git a/include/netlink.h b/include/netlink.h index e6941714..53a55b61 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -133,7 +133,7 @@ extern int netlink_get_setelem(struct netlink_ctx *ctx, const struct handle *h, const struct location *loc, struct table *table, struct set *set, struct expr *init); extern int netlink_delinearize_setelem(struct nftnl_set_elem *nlse, - const struct set *set, + struct set *set, struct nft_cache *cache); extern int netlink_list_objs(struct netlink_ctx *ctx, const struct handle *h); -- cgit v1.2.3