summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cache.c2
-rw-r--r--src/rule.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/cache.c b/src/cache.c
index a45111a7..7797ff6b 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -143,6 +143,8 @@ unsigned int cache_evaluate(struct nft_ctx *nft, struct list_head *cmds)
break;
case CMD_LIST:
case CMD_EXPORT:
+ flags |= NFT_CACHE_FULL | NFT_CACHE_REFRESH;
+ break;
case CMD_MONITOR:
flags |= NFT_CACHE_FULL;
break;
diff --git a/src/rule.c b/src/rule.c
index 6335aa21..8dc1792b 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -237,6 +237,11 @@ static bool cache_is_complete(struct nft_cache *cache, unsigned int flags)
return (cache->flags & flags) == flags;
}
+static bool cache_needs_refresh(struct nft_cache *cache)
+{
+ return cache->flags & NFT_CACHE_REFRESH;
+}
+
static bool cache_is_updated(struct nft_cache *cache, uint16_t genid)
{
return genid && genid == cache->genid;
@@ -261,7 +266,8 @@ int cache_update(struct nft_ctx *nft, unsigned int flags, struct list_head *msgs
replay:
ctx.seqnum = cache->seqnum++;
genid = mnl_genid_get(&ctx);
- if (cache_is_complete(cache, flags) &&
+ if (!cache_needs_refresh(cache) &&
+ cache_is_complete(cache, flags) &&
cache_is_updated(cache, genid))
return 0;