]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
cache: honor table in set filtering
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 25 Oct 2021 21:46:36 +0000 (23:46 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 26 Oct 2021 22:37:46 +0000 (00:37 +0200)
Check if table mismatch, in case the same set name is used in different
tables.

Fixes: 635ee1cad8aa ("cache: filter out sets and maps that are not requested")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/cache.c

index 691e8131c49436b54f5043ff68a5101f37772fb6..f62c9b96f528311976abbe6817d91e2166166302 100644 (file)
@@ -377,7 +377,8 @@ static int set_cache_cb(struct nftnl_set *nls, void *arg)
                return -1;
 
        if (ctx->filter && ctx->filter->set &&
-           (strcmp(ctx->filter->set, set->handle.set.name))) {
+           (strcmp(ctx->filter->table, set->handle.table.name) ||
+            strcmp(ctx->filter->set, set->handle.set.name))) {
                set_free(set);
                return 0;
        }