summaryrefslogtreecommitdiff
path: root/net/netfilter
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2021-06-04 12:27:06 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2021-06-07 12:23:38 +0200
commit7b4b2fa37587394fb89fa51a4bea0820a1b37a5d (patch)
tree75f08548b3079f0333a85a4daf5dfb216680fb6a /net/netfilter
parent1d91d2e1a7f767aa8c11d8507ecf268f787734ec (diff)
netfilter: annotate nf_tables base hook ops
This will allow a followup patch to treat the 'ops->priv' pointer as nft_chain argument without having to first walk the table/chains to check if there is a matching base chain pointer. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_tables_api.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 6c2000a11c7e..c9308241b688 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2168,8 +2168,10 @@ static int nf_tables_addchain(struct nft_ctx *ctx, u8 family, u8 genmask,
}
nft_trans_chain_policy(trans) = NFT_CHAIN_POLICY_UNSET;
- if (nft_is_base_chain(chain))
+ if (nft_is_base_chain(chain)) {
+ basechain->ops.hook_ops_type = NF_HOOK_OP_NF_TABLES;
nft_trans_chain_policy(trans) = policy;
+ }
err = nft_chain_add(table, chain);
if (err < 0) {