aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-03-07 13:08:29 -0500
committerPablo Neira Ayuso <pablo@netfilter.org>2014-03-08 06:35:16 -0500
commita36e901cf60d4e9a1882d2a98b1a9c60e84aff2c (patch)
tree6da2715ce590e720365aa5009dacb58f47acb316
parentce6eb0d7c8ec16753f817054e2a566504327e274 (diff)
netfilter: nf_tables: clean up nf_tables_trans_add() argument order
The context argument logically comes first, and this is what every other function dealing with contexts does. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--net/netfilter/nf_tables_api.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index f25d0110fe95..611afc0cf2d5 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1557,7 +1557,7 @@ static void nf_tables_rule_destroy(struct nft_rule *rule)
1557static struct nft_expr_info *info; 1557static struct nft_expr_info *info;
1558 1558
1559static struct nft_rule_trans * 1559static struct nft_rule_trans *
1560nf_tables_trans_add(struct nft_rule *rule, const struct nft_ctx *ctx) 1560nf_tables_trans_add(struct nft_ctx *ctx, struct nft_rule *rule)
1561{ 1561{
1562 struct nft_rule_trans *rupd; 1562 struct nft_rule_trans *rupd;
1563 1563
@@ -1683,7 +1683,7 @@ static int nf_tables_newrule(struct sock *nlsk, struct sk_buff *skb,
1683 1683
1684 if (nlh->nlmsg_flags & NLM_F_REPLACE) { 1684 if (nlh->nlmsg_flags & NLM_F_REPLACE) {
1685 if (nft_rule_is_active_next(net, old_rule)) { 1685 if (nft_rule_is_active_next(net, old_rule)) {
1686 repl = nf_tables_trans_add(old_rule, &ctx); 1686 repl = nf_tables_trans_add(&ctx, old_rule);
1687 if (repl == NULL) { 1687 if (repl == NULL) {
1688 err = -ENOMEM; 1688 err = -ENOMEM;
1689 goto err2; 1689 goto err2;
@@ -1706,7 +1706,7 @@ static int nf_tables_newrule(struct sock *nlsk, struct sk_buff *skb,
1706 list_add_rcu(&rule->list, &chain->rules); 1706 list_add_rcu(&rule->list, &chain->rules);
1707 } 1707 }
1708 1708
1709 if (nf_tables_trans_add(rule, &ctx) == NULL) { 1709 if (nf_tables_trans_add(&ctx, rule) == NULL) {
1710 err = -ENOMEM; 1710 err = -ENOMEM;
1711 goto err3; 1711 goto err3;
1712 } 1712 }
@@ -1735,7 +1735,7 @@ nf_tables_delrule_one(struct nft_ctx *ctx, struct nft_rule *rule)
1735{ 1735{
1736 /* You cannot delete the same rule twice */ 1736 /* You cannot delete the same rule twice */
1737 if (nft_rule_is_active_next(ctx->net, rule)) { 1737 if (nft_rule_is_active_next(ctx->net, rule)) {
1738 if (nf_tables_trans_add(rule, ctx) == NULL) 1738 if (nf_tables_trans_add(ctx, rule) == NULL)
1739 return -ENOMEM; 1739 return -ENOMEM;
1740 nft_rule_disactivate_next(ctx->net, rule); 1740 nft_rule_disactivate_next(ctx->net, rule);
1741 return 0; 1741 return 0;