netfilter: nf_tables: add enum nft_flowtable_flags to uapi
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 24 Mar 2020 11:23:57 +0000 (12:23 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 27 Mar 2020 17:32:36 +0000 (18:32 +0100)
Expose the NFT_FLOWTABLE_HW_OFFLOAD flag through uapi.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_flow_table.h
include/uapi/linux/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c

index f523ea87b6ae7e325b05d41570e30f7d21e9f819..4beb7f13bc50846a26687e5b97999ce9af7ed820 100644 (file)
@@ -62,7 +62,7 @@ struct nf_flowtable_type {
 };
 
 enum nf_flowtable_flags {
-       NF_FLOWTABLE_HW_OFFLOAD         = 0x1,
+       NF_FLOWTABLE_HW_OFFLOAD         = 0x1,  /* NFT_FLOWTABLE_HW_OFFLOAD */
 };
 
 struct nf_flowtable {
index 4e3a5971d4eed79492b7bcda52dcad230a9fe525..717ee3aa05d7ee0961c7b8c1489c5df027634c84 100644 (file)
@@ -1553,6 +1553,16 @@ enum nft_object_attributes {
 };
 #define NFTA_OBJ_MAX           (__NFTA_OBJ_MAX - 1)
 
+/**
+ * enum nft_flowtable_flags - nf_tables flowtable flags
+ *
+ * @NFT_FLOWTABLE_HW_OFFLOAD: flowtable hardware offload is enabled
+ */
+enum nft_flowtable_flags {
+       NFT_FLOWTABLE_HW_OFFLOAD        = 0x1,
+       NFT_FLOWTABLE_MASK              = NFT_FLOWTABLE_HW_OFFLOAD
+};
+
 /**
  * enum nft_flowtable_attributes - nf_tables flow table netlink attributes
  *
index c5332a313283e85f6fe099592a82215c011e9a56..ace325218edb16abe3ebff686ad5fa941e52ce62 100644 (file)
@@ -6375,7 +6375,7 @@ static int nf_tables_newflowtable(struct net *net, struct sock *nlsk,
        if (nla[NFTA_FLOWTABLE_FLAGS]) {
                flowtable->data.flags =
                        ntohl(nla_get_be32(nla[NFTA_FLOWTABLE_FLAGS]));
-               if (flowtable->data.flags & ~NF_FLOWTABLE_HW_OFFLOAD)
+               if (flowtable->data.flags & ~NFT_FLOWTABLE_MASK)
                        goto err3;
        }