summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_tables_api.c
diff options
context:
space:
mode:
authorPatrick McHardy2014-01-09 19:42:38 +0100
committerPablo Neira Ayuso2014-01-09 20:17:15 +0100
commitfa2c1de0bbd98985f7f930205de97ae0d3e86c16 (patch)
treef9f8eec3da27c7934a2241bf05e5054a9767eddf /net/netfilter/nf_tables_api.c
parentnetfilter: nf_tables: constify chain type definitions and pointers (diff)
downloadkernel-qcow2-linux-fa2c1de0bbd98985f7f930205de97ae0d3e86c16.tar.gz
kernel-qcow2-linux-fa2c1de0bbd98985f7f930205de97ae0d3e86c16.tar.xz
kernel-qcow2-linux-fa2c1de0bbd98985f7f930205de97ae0d3e86c16.zip
netfilter: nf_tables: minor nf_chain_type cleanups
Minor nf_chain_type cleanups: - reorder struct to plug a hoe - rename struct module member to "owner" for consistency - rename nf_hookfn array to "hooks" for consistency - reorder initializers for better readability Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_tables_api.c')
-rw-r--r--net/netfilter/nf_tables_api.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index acdd9d68d52f..c8ca3b8762b4 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -929,9 +929,9 @@ static int nf_tables_newchain(struct sock *nlsk, struct sk_buff *skb,
if (!(type->hook_mask & (1 << hooknum)))
return -EOPNOTSUPP;
- if (!try_module_get(type->me))
+ if (!try_module_get(type->owner))
return -ENOENT;
- hookfn = type->fn[hooknum];
+ hookfn = type->hooks[hooknum];
basechain = kzalloc(sizeof(*basechain), GFP_KERNEL);
if (basechain == NULL)
@@ -941,7 +941,7 @@ static int nf_tables_newchain(struct sock *nlsk, struct sk_buff *skb,
err = nf_tables_counters(basechain,
nla[NFTA_CHAIN_COUNTERS]);
if (err < 0) {
- module_put(type->me);
+ module_put(type->owner);
kfree(basechain);
return err;
}
@@ -950,7 +950,7 @@ static int nf_tables_newchain(struct sock *nlsk, struct sk_buff *skb,
newstats = alloc_percpu(struct nft_stats);
if (newstats == NULL) {
- module_put(type->me);
+ module_put(type->owner);
kfree(basechain);
return -ENOMEM;
}
@@ -992,7 +992,7 @@ static int nf_tables_newchain(struct sock *nlsk, struct sk_buff *skb,
chain->flags & NFT_BASE_CHAIN) {
err = nf_register_hooks(nft_base_chain(chain)->ops, afi->nops);
if (err < 0) {
- module_put(basechain->type->me);
+ module_put(basechain->type->owner);
free_percpu(basechain->stats);
kfree(basechain);
return err;
@@ -1013,7 +1013,7 @@ static void nf_tables_rcu_chain_destroy(struct rcu_head *head)
BUG_ON(chain->use > 0);
if (chain->flags & NFT_BASE_CHAIN) {
- module_put(nft_base_chain(chain)->type->me);
+ module_put(nft_base_chain(chain)->type->owner);
free_percpu(nft_base_chain(chain)->stats);
kfree(nft_base_chain(chain));
} else