Commit a36e901c authored by Patrick McHardy's avatar Patrick McHardy Committed by Pablo Neira Ayuso

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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent ce6eb0d7
...@@ -1557,7 +1557,7 @@ static void nf_tables_rule_destroy(struct nft_rule *rule) ...@@ -1557,7 +1557,7 @@ static void nf_tables_rule_destroy(struct nft_rule *rule)
static struct nft_expr_info *info; static struct nft_expr_info *info;
static struct nft_rule_trans * static struct nft_rule_trans *
nf_tables_trans_add(struct nft_rule *rule, const struct nft_ctx *ctx) nf_tables_trans_add(struct nft_ctx *ctx, struct nft_rule *rule)
{ {
struct nft_rule_trans *rupd; struct nft_rule_trans *rupd;
...@@ -1683,7 +1683,7 @@ static int nf_tables_newrule(struct sock *nlsk, struct sk_buff *skb, ...@@ -1683,7 +1683,7 @@ static int nf_tables_newrule(struct sock *nlsk, struct sk_buff *skb,
if (nlh->nlmsg_flags & NLM_F_REPLACE) { if (nlh->nlmsg_flags & NLM_F_REPLACE) {
if (nft_rule_is_active_next(net, old_rule)) { if (nft_rule_is_active_next(net, old_rule)) {
repl = nf_tables_trans_add(old_rule, &ctx); repl = nf_tables_trans_add(&ctx, old_rule);
if (repl == NULL) { if (repl == NULL) {
err = -ENOMEM; err = -ENOMEM;
goto err2; goto err2;
...@@ -1706,7 +1706,7 @@ static int nf_tables_newrule(struct sock *nlsk, struct sk_buff *skb, ...@@ -1706,7 +1706,7 @@ static int nf_tables_newrule(struct sock *nlsk, struct sk_buff *skb,
list_add_rcu(&rule->list, &chain->rules); list_add_rcu(&rule->list, &chain->rules);
} }
if (nf_tables_trans_add(rule, &ctx) == NULL) { if (nf_tables_trans_add(&ctx, rule) == NULL) {
err = -ENOMEM; err = -ENOMEM;
goto err3; goto err3;
} }
...@@ -1735,7 +1735,7 @@ nf_tables_delrule_one(struct nft_ctx *ctx, struct nft_rule *rule) ...@@ -1735,7 +1735,7 @@ nf_tables_delrule_one(struct nft_ctx *ctx, struct nft_rule *rule)
{ {
/* You cannot delete the same rule twice */ /* You cannot delete the same rule twice */
if (nft_rule_is_active_next(ctx->net, rule)) { if (nft_rule_is_active_next(ctx->net, rule)) {
if (nf_tables_trans_add(rule, ctx) == NULL) if (nf_tables_trans_add(ctx, rule) == NULL)
return -ENOMEM; return -ENOMEM;
nft_rule_disactivate_next(ctx->net, rule); nft_rule_disactivate_next(ctx->net, rule);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment