]> git.ipfire.org Git - thirdparty/nftables.git/commit
mnl: introduce NFT_NLMSG_MAXSIZE
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 22 Jul 2014 20:16:59 +0000 (22:16 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 25 Jul 2014 01:41:17 +0000 (03:41 +0200)
commite2b60d54ab2f580cb4aef5a01c7b36a02aee6cc6
tree5922119e9a279d4091dd5c56da58cc3ca7c05bbe
parentfd3479639d0a43399a15995add9d4abbcf40f22c
mnl: introduce NFT_NLMSG_MAXSIZE

The NFT_NLMSG_MAXSIZE constant defines the maximum nf_tables netlink
message. Currently, the largest is the set element message, which
contains the NFTA_SET_ELEM_LIST_ELEMENTS attribute. This attribute is
a nest that describes the set elements. Given that the netlink attribute
length (nla_len) is 16 bits, the largest message is a bit larger than
64 KBytes. Thus, the proposed value of NFT_NLMSG_MAXSIZE is set to
(1 << 16) + getpagesize().

This new constant is used to calculate the length of:

1) the batch page length, when the batching mode is used.

2) the buffer that stores the netlink message in the send (when no
   batching is used) and receive paths.

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