Skip to content

Commit 67c49de

Browse files
committed
netfilter: nf_tables: expose enum nft_chain_flags through UAPI
This enum definition was never exposed through UAPI. Rename NFT_BASE_CHAIN to NFT_CHAIN_BASE for consistency. Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 51d70f1 commit 67c49de

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

include/net/netfilter/nf_tables.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -921,11 +921,6 @@ static inline void nft_set_elem_update_expr(const struct nft_set_ext *ext,
921921
(expr) != (last); \
922922
(expr) = nft_expr_next(expr))
923923

924-
enum nft_chain_flags {
925-
NFT_BASE_CHAIN = 0x1,
926-
NFT_CHAIN_HW_OFFLOAD = 0x2,
927-
};
928-
929924
#define NFT_CHAIN_POLICY_UNSET U8_MAX
930925

931926
/**
@@ -1036,7 +1031,7 @@ static inline struct nft_base_chain *nft_base_chain(const struct nft_chain *chai
10361031

10371032
static inline bool nft_is_base_chain(const struct nft_chain *chain)
10381033
{
1039-
return chain->flags & NFT_BASE_CHAIN;
1034+
return chain->flags & NFT_CHAIN_BASE;
10401035
}
10411036

10421037
int __nft_release_basechain(struct nft_ctx *ctx);

include/uapi/linux/netfilter/nf_tables.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ enum nft_table_attributes {
184184
};
185185
#define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1)
186186

187+
enum nft_chain_flags {
188+
NFT_CHAIN_BASE = (1 << 0),
189+
NFT_CHAIN_HW_OFFLOAD = (1 << 1),
190+
};
191+
187192
/**
188193
* enum nft_chain_attributes - nf_tables chain netlink attributes
189194
*

net/netfilter/nf_tables_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ static int nft_basechain_init(struct nft_base_chain *basechain, u8 family,
19031903
nft_basechain_hook_init(&basechain->ops, family, hook, chain);
19041904
}
19051905

1906-
chain->flags |= NFT_BASE_CHAIN | flags;
1906+
chain->flags |= NFT_CHAIN_BASE | flags;
19071907
basechain->policy = NF_ACCEPT;
19081908
if (chain->flags & NFT_CHAIN_HW_OFFLOAD &&
19091909
nft_chain_offload_priority(basechain) < 0)
@@ -2255,7 +2255,7 @@ static int nf_tables_newchain(struct net *net, struct sock *nlsk,
22552255
if (nlh->nlmsg_flags & NLM_F_REPLACE)
22562256
return -EOPNOTSUPP;
22572257

2258-
flags |= chain->flags & NFT_BASE_CHAIN;
2258+
flags |= chain->flags & NFT_CHAIN_BASE;
22592259
return nf_tables_updchain(&ctx, genmask, policy, flags);
22602260
}
22612261

0 commit comments

Comments
 (0)