netfilter: nf_tables: disabling table hooks always succeeds

nf_tables_table_disable() always succeeds, make this function void.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Pablo Neira Ayuso 2014-03-30 14:04:52 +02:00
parent 91c7b38dc9
commit f75edf5e9c

View File

@ -381,7 +381,7 @@ err:
return err; 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_table *table)
{ {
struct nft_chain *chain; struct nft_chain *chain;
@ -391,8 +391,6 @@ static int nf_tables_table_disable(const struct nft_af_info *afi,
nf_unregister_hooks(nft_base_chain(chain)->ops, nf_unregister_hooks(nft_base_chain(chain)->ops,
afi->nops); afi->nops);
} }
return 0;
} }
static int nf_tables_updtable(struct sock *nlsk, struct sk_buff *skb, static int nf_tables_updtable(struct sock *nlsk, struct sk_buff *skb,
@ -412,9 +410,8 @@ static int nf_tables_updtable(struct sock *nlsk, struct sk_buff *skb,
if ((flags & NFT_TABLE_F_DORMANT) && if ((flags & NFT_TABLE_F_DORMANT) &&
!(table->flags & NFT_TABLE_F_DORMANT)) { !(table->flags & NFT_TABLE_F_DORMANT)) {
ret = nf_tables_table_disable(afi, table); nf_tables_table_disable(afi, table);
if (ret >= 0) table->flags |= NFT_TABLE_F_DORMANT;
table->flags |= NFT_TABLE_F_DORMANT;
} else if (!(flags & NFT_TABLE_F_DORMANT) && } else if (!(flags & NFT_TABLE_F_DORMANT) &&
table->flags & NFT_TABLE_F_DORMANT) { table->flags & NFT_TABLE_F_DORMANT) {
ret = nf_tables_table_enable(afi, table); ret = nf_tables_table_enable(afi, table);