netfilter: nf_tables: disabling table hooks always succeeds
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 30 Mar 2014 12:04:52 +0000 (14:04 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 19 May 2014 10:06:11 +0000 (12:06 +0200)
nf_tables_table_disable() always succeeds, make this function void.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c

index 7a1149fe21008728e381c71dad2d0063c7c1dd8e..5f717032b2a5551c3b7262e00174beca038327c0 100644 (file)
@@ -381,7 +381,7 @@ 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_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,
                                            afi->nops);
        }
-
-       return 0;
 }
 
 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) &&
                    !(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);