]> granicus.if.org Git - ipset/commitdiff
Fix the message sequence number book-keeping
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 24 May 2011 07:34:01 +0000 (09:34 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 24 May 2011 07:34:01 +0000 (09:34 +0200)
The internal messages mix with the public messages and that confused
the sequence number book-keeping. Move setting/updating into
ipset_mnl_query.

lib/mnl.c

index d18ec044504dc3f2d713ea287c4da83f566e3cb2..9b7267cf4705adcb98517654feb82bf2a21f144a 100644 (file)
--- a/lib/mnl.c
+++ b/lib/mnl.c
@@ -75,7 +75,6 @@ ipset_mnl_fill_hdr(struct ipset_handle *handle, enum ipset_cmd cmd,
        nlh->nlmsg_flags = cmdflags[cmd - 1];
        if (envflags & IPSET_ENV_EXIST)
                nlh->nlmsg_flags &=  ~NLM_F_EXCL;
-       nlh->nlmsg_seq = ++handle->seq;
 
        nfg = mnl_nlmsg_put_extra_header(nlh, sizeof(struct nfgenmsg));
        nfg->nfgen_family = AF_INET;
@@ -92,6 +91,7 @@ ipset_mnl_query(struct ipset_handle *handle, void *buffer, size_t len)
        assert(handle);
        assert(buffer);
 
+       nlh->nlmsg_seq = ++handle->seq;
 #ifdef IPSET_DEBUG
        ipset_debug_msg("sent", nlh, nlh->nlmsg_len);
 #endif