Skip to content

Commit

Permalink
netfilter: nf_tables: disabling table hooks always succeeds
Browse files Browse the repository at this point in the history
nf_tables_table_disable() always succeeds, make this function void.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Pablo Neira Ayuso committed May 19, 2014
1 parent 91c7b38 commit f75edf5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ static int nf_tables_table_enable(const struct nft_af_info *afi,
return err;
}

static int nf_tables_table_disable(const struct nft_af_info *afi,
static void nf_tables_table_disable(const struct nft_af_info *afi,
struct nft_table *table)
{
struct nft_chain *chain;
Expand All @@ -391,8 +391,6 @@ static int nf_tables_table_disable(const struct nft_af_info *afi,
nf_unregister_hooks(nft_base_chain(chain)->ops,
afi->nops);
}

return 0;
}

static int nf_tables_updtable(struct sock *nlsk, struct sk_buff *skb,
Expand All @@ -412,9 +410,8 @@ static int nf_tables_updtable(struct sock *nlsk, struct sk_buff *skb,

if ((flags & NFT_TABLE_F_DORMANT) &&
!(table->flags & NFT_TABLE_F_DORMANT)) {
ret = nf_tables_table_disable(afi, table);
if (ret >= 0)
table->flags |= NFT_TABLE_F_DORMANT;
nf_tables_table_disable(afi, table);
table->flags |= NFT_TABLE_F_DORMANT;
} else if (!(flags & NFT_TABLE_F_DORMANT) &&
table->flags & NFT_TABLE_F_DORMANT) {
ret = nf_tables_table_enable(afi, table);
Expand Down

0 comments on commit f75edf5

Please sign in to comment.