Check for generation ID after the cache is populated. In case of
interference, release the inconsistent cache and retry.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
.nft = nft,
};
struct nft_cache *cache = &nft->cache;
- uint32_t genid;
+ uint32_t genid, genid_stop;
int ret;
replay:
ctx.seqnum = cache->seqnum++;
}
return -1;
}
+
+ genid_stop = mnl_genid_get(&ctx);
+ if (genid != genid_stop) {
+ cache_release(cache);
+ goto replay;
+ }
+
cache->genid = genid;
cache->cmd = cmd;
return 0;