From 0d9d04c31481c7c73b4ba64f0ad746b84c4250c5 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 14 Aug 2017 17:47:21 +0200 Subject: src: make netlink sequence number non-static Place sequence number that is allocated per-command on the struct netlink_ctx structure. This is allocated from nft_run() to correlate commands with netlink messages for error reporting. Batch support probing also shares this sequence numbers with commands. There is an inpendent cache sequence number though, this routine is called from a different path, usually from the evaluation phase. Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index 38cd648e..ef12becd 100644 --- a/src/rule.c +++ b/src/rule.c @@ -135,6 +135,7 @@ static int cache_init(struct mnl_socket *nf_sock, struct nft_cache *cache, ctx.nf_sock = nf_sock; ctx.cache = cache; ctx.msgs = msgs; + ctx.seqnum = cache->seqnum++; ret = cache_init_tables(&ctx, &handle, cache); if (ret < 0) @@ -154,7 +155,7 @@ int cache_update(struct mnl_socket *nf_sock, struct nft_cache *cache, if (cache->initialized) return 0; replay: - netlink_genid_get(nf_sock); + netlink_genid_get(nf_sock, cache->seqnum++); ret = cache_init(nf_sock, cache, cmd, msgs); if (ret < 0) { cache_release(cache); -- cgit v1.2.3