]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: add size description for constant sets
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 26 May 2017 10:49:19 +0000 (11:49 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 26 May 2017 10:49:19 +0000 (12:49 +0200)
The kernel side can make better decisions with this information when
selecting the right backend, so add this information to the set netlink
message.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/netlink.c

index 59e8918d2ba0ceba5dfaf196d6dc4c17c7709fcc..28821903f18cc997245a312d06b426975afecb8b 100644 (file)
@@ -1293,6 +1293,8 @@ static int netlink_add_set_batch(struct netlink_ctx *ctx,
                if (set->desc.size != 0)
                        nftnl_set_set_u32(nls, NFTNL_SET_DESC_SIZE,
                                          set->desc.size);
+       } else if (set->init) {
+               nftnl_set_set_u32(nls, NFTNL_SET_DESC_SIZE, set->init->size);
        }
 
        udbuf = nftnl_udata_buf_alloc(NFT_USERDATA_MAXLEN);