summaryrefslogtreecommitdiffstats
path: root/src/cache.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2022-01-12 01:33:58 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2022-01-15 18:15:23 +0100
commitafbd102211dcc52dfdc2332e171d21e769f7e70e (patch)
tree23d0ad17ccb5bd0b14c5a401cf498f60d97979fa /src/cache.c
parent345d9260f7fe8ba62fd1700489a1d78cd533f59d (diff)
src: do not use the nft_cache_filter object from mnl.c
Pass the table and chain strings to mnl_nft_rule_dump() instead. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cache.c b/src/cache.c
index 6494e474..6ca6bbc6 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -478,8 +478,15 @@ static int rule_cache_init(struct netlink_ctx *ctx, const struct handle *h,
const struct nft_cache_filter *filter)
{
struct nftnl_rule_list *rule_cache;
+ const char *table;
+ const char *chain;
- rule_cache = mnl_nft_rule_dump(ctx, h->family, filter);
+ if (filter) {
+ table = filter->list.table;
+ chain = filter->list.chain;
+ }
+
+ rule_cache = mnl_nft_rule_dump(ctx, h->family, table, chain);
if (rule_cache == NULL) {
if (errno == EINTR)
return -1;