1 From: Pablo Neira Ayuso <pablo@netfilter.org>
2 Date: Tue, 19 Dec 2017 12:17:52 +0100
3 Subject: [PATCH] netfilter: nf_tables: no need for struct nft_af_info to
6 nf_tables_table_enable() and nf_tables_table_disable() take a pointer to
7 struct nft_af_info that is never used, remove it.
9 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
12 --- a/net/netfilter/nf_tables_api.c
13 +++ b/net/netfilter/nf_tables_api.c
14 @@ -640,10 +640,7 @@ err:
18 -static void _nf_tables_table_disable(struct net *net,
19 - const struct nft_af_info *afi,
20 - struct nft_table *table,
22 +static void nft_table_disable(struct net *net, struct nft_table *table, u32 cnt)
24 struct nft_chain *chain;
26 @@ -661,9 +658,7 @@ static void _nf_tables_table_disable(str
30 -static int nf_tables_table_enable(struct net *net,
31 - const struct nft_af_info *afi,
32 - struct nft_table *table)
33 +static int nf_tables_table_enable(struct net *net, struct nft_table *table)
35 struct nft_chain *chain;
37 @@ -683,15 +678,13 @@ static int nf_tables_table_enable(struct
41 - _nf_tables_table_disable(net, afi, table, i);
42 + nft_table_disable(net, table, i);
46 -static void nf_tables_table_disable(struct net *net,
47 - const struct nft_af_info *afi,
48 - struct nft_table *table)
49 +static void nf_tables_table_disable(struct net *net, struct nft_table *table)
51 - _nf_tables_table_disable(net, afi, table, 0);
52 + nft_table_disable(net, table, 0);
55 static int nf_tables_updtable(struct nft_ctx *ctx)
56 @@ -720,7 +713,7 @@ static int nf_tables_updtable(struct nft
57 nft_trans_table_enable(trans) = false;
58 } else if (!(flags & NFT_TABLE_F_DORMANT) &&
59 ctx->table->flags & NFT_TABLE_F_DORMANT) {
60 - ret = nf_tables_table_enable(ctx->net, ctx->afi, ctx->table);
61 + ret = nf_tables_table_enable(ctx->net, ctx->table);
63 ctx->table->flags &= ~NFT_TABLE_F_DORMANT;
64 nft_trans_table_enable(trans) = true;
65 @@ -5791,7 +5784,6 @@ static int nf_tables_commit(struct net *
66 if (nft_trans_table_update(trans)) {
67 if (!nft_trans_table_enable(trans)) {
68 nf_tables_table_disable(net,
71 trans->ctx.table->flags |= NFT_TABLE_F_DORMANT;
73 @@ -5955,7 +5947,6 @@ static int nf_tables_abort(struct net *n
74 if (nft_trans_table_update(trans)) {
75 if (nft_trans_table_enable(trans)) {
76 nf_tables_table_disable(net,
79 trans->ctx.table->flags |= NFT_TABLE_F_DORMANT;