[PATCH nft 3/4] cache: honor filter in set listing commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fetch table, set and set elements only for set listing commands, e.g.
nft list set inet filter ipv4_bogons.

Fixes: 635ee1cad8aa ("cache: filter out sets and maps that are not requested")
Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 src/cache.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/cache.c b/src/cache.c
index 3cbf99e8e124..691e8131c494 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -146,6 +146,8 @@ static unsigned int evaluate_cache_list(struct nft_ctx *nft, struct cmd *cmd,
 		}
 		if (nft_output_terse(&nft->output))
 			flags |= (NFT_CACHE_FULL & ~NFT_CACHE_SETELEM);
+		else if (filter->table && filter->set)
+			flags |= NFT_CACHE_TABLE | NFT_CACHE_SET | NFT_CACHE_SETELEM;
 		else
 			flags |= NFT_CACHE_FULL;
 		break;
-- 
2.30.2




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux