Re: [PATCH libnftnl v3 1/2] set: Add support for NFTA_SET_DESC_CONCAT attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 19, 2020 at 02:35:25PM +0100, Stefano Brivio wrote:
> If NFTNL_SET_DESC_CONCAT data is passed, pass that to the kernel
> as NFTA_SET_DESC_CONCAT attributes: it describes the length of
> single concatenated fields, in bytes.
> 
> Similarly, parse NFTA_SET_DESC_CONCAT attributes if received
> from the kernel.
> 
> This is the libnftnl counterpart for nftables patch:
>   src: Add support for NFTNL_SET_DESC_CONCAT
> 
> v3:
>  - use NFTNL_SET_DESC_CONCAT and NFTA_SET_DESC_CONCAT instead of a
>    stand-alone NFTA_SET_SUBKEY attribute (Pablo Neira Ayuso)
>  - pass field length in bytes instead of bits, fields would get
>    unnecessarily big otherwise
> v2:
>  - fixed grammar in commit message
>  - removed copy of array bytes in nftnl_set_nlmsg_build_subkey_payload(),
>    we're simply passing values to htonl() (Phil Sutter)
> 
> Signed-off-by: Stefano Brivio <sbrivio@xxxxxxxxxx>
> ---
>  include/libnftnl/set.h |   1 +
>  include/set.h          |   2 +
>  src/set.c              | 111 ++++++++++++++++++++++++++++++++++-------
>  3 files changed, 95 insertions(+), 19 deletions(-)
> 
> diff --git a/include/libnftnl/set.h b/include/libnftnl/set.h
> index db3fa686d60a..dcae354b76c4 100644
> --- a/include/libnftnl/set.h
> +++ b/include/libnftnl/set.h
> @@ -24,6 +24,7 @@ enum nftnl_set_attr {
>  	NFTNL_SET_ID,
>  	NFTNL_SET_POLICY,
>  	NFTNL_SET_DESC_SIZE,
> +	NFTNL_SET_DESC_CONCAT,

This one needs to be defined at the end to not break binary interface.

Compilation breaks for some reason:

In file included from ../include/internal.h:10,
                 from gen.c:9:
../include/set.h:28:22: error: ‘NFT_REG32_COUNT’ undeclared here (not
in a function); did you mean ‘NFT_REG32_15’?
   28 |   uint8_t  field_len[NFT_REG32_COUNT];
      |                      ^~~~~~~~~~~~~~~
      |                      NFT_REG32_15

Thanks.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux