From ac4b25b3ca045fbbed86773a91da52d9d7ee3091 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 28 Jul 2020 17:57:20 +0200 Subject: src: remove cache lookups after the evaluation phase This patch adds a new field to the cmd structure for elements to store a reference to the set. This saves an extra lookup in the netlink bytecode generation step. This patch also allows to incrementally update during the evaluation phase according to the command actions, which is required by the follow up ("evaluate: remove table from cache on delete table") bugfix patch. Signed-off-by: Pablo Neira Ayuso --- src/netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/netlink.c') diff --git a/src/netlink.c b/src/netlink.c index b57e1c55..2f1dbe17 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -1228,7 +1228,7 @@ int netlink_list_setelems(struct netlink_ctx *ctx, const struct handle *h, } int netlink_get_setelem(struct netlink_ctx *ctx, const struct handle *h, - const struct location *loc, struct table *table, + const struct location *loc, struct set *cache_set, struct set *set, struct expr *init) { struct nftnl_set *nls, *nls_out = NULL; @@ -1261,7 +1261,7 @@ int netlink_get_setelem(struct netlink_ctx *ctx, const struct handle *h, if (set->flags & NFT_SET_INTERVAL && set->desc.field_count > 1) concat_range_aggregate(set->init); else if (set->flags & NFT_SET_INTERVAL) - err = get_set_decompose(table, set); + err = get_set_decompose(cache_set, set); else list_expr_sort(&ctx->set->init->expressions); -- cgit v1.2.3