(flags & NFT_CACHE_REFRESH);
}
-static bool nft_cache_is_updated(struct nft_cache *cache, uint16_t genid)
+static bool nft_cache_is_updated(struct nft_cache *cache, unsigned int flags,
+ uint16_t genid)
{
- return genid && genid == cache->genid;
+ if (!genid)
+ return false;
+
+ if (genid == cache->genid)
+ return true;
+
+ if (genid == cache->genid + 1) {
+ cache->genid++;
+ return true;
+ }
+
+ return false;
}
bool nft_cache_needs_update(struct nft_cache *cache)
genid = mnl_genid_get(&ctx);
if (!nft_cache_needs_refresh(cache, flags) &&
nft_cache_is_complete(cache, flags) &&
- nft_cache_is_updated(cache, genid))
+ nft_cache_is_updated(cache, flags, genid))
return 0;
if (cache->genid)