Skip to content

Commit cfbd112

Browse files
committed
netfilter: nf_tables: add enum nft_flowtable_flags to uapi
Expose the NFT_FLOWTABLE_HW_OFFLOAD flag through uapi. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 8ac2bd3 commit cfbd112

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎include/net/netfilter/nf_flow_table.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct nf_flowtable_type {
6262
};
6363

6464
enum nf_flowtable_flags {
65-
NF_FLOWTABLE_HW_OFFLOAD = 0x1,
65+
NF_FLOWTABLE_HW_OFFLOAD = 0x1, /* NFT_FLOWTABLE_HW_OFFLOAD */
6666
};
6767

6868
struct nf_flowtable {

‎include/uapi/linux/netfilter/nf_tables.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,6 +1553,16 @@ enum nft_object_attributes {
15531553
};
15541554
#define NFTA_OBJ_MAX (__NFTA_OBJ_MAX - 1)
15551555

1556+
/**
1557+
* enum nft_flowtable_flags - nf_tables flowtable flags
1558+
*
1559+
* @NFT_FLOWTABLE_HW_OFFLOAD: flowtable hardware offload is enabled
1560+
*/
1561+
enum nft_flowtable_flags {
1562+
NFT_FLOWTABLE_HW_OFFLOAD = 0x1,
1563+
NFT_FLOWTABLE_MASK = NFT_FLOWTABLE_HW_OFFLOAD
1564+
};
1565+
15561566
/**
15571567
* enum nft_flowtable_attributes - nf_tables flow table netlink attributes
15581568
*

‎net/netfilter/nf_tables_api.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6375,7 +6375,7 @@ static int nf_tables_newflowtable(struct net *net, struct sock *nlsk,
63756375
if (nla[NFTA_FLOWTABLE_FLAGS]) {
63766376
flowtable->data.flags =
63776377
ntohl(nla_get_be32(nla[NFTA_FLOWTABLE_FLAGS]));
6378-
if (flowtable->data.flags & ~NF_FLOWTABLE_HW_OFFLOAD)
6378+
if (flowtable->data.flags & ~NFT_FLOWTABLE_MASK)
63796379
goto err3;
63806380
}
63816381

0 commit comments

Comments
 (0)