Skip to content

Commit a36e901

Browse files
kaberummakynes
authored andcommitted
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>
1 parent ce6eb0d commit a36e901

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎net/netfilter/nf_tables_api.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ static void nf_tables_rule_destroy(struct nft_rule *rule)
15571557
static struct nft_expr_info *info;
15581558

15591559
static struct nft_rule_trans *
1560-
nf_tables_trans_add(struct nft_rule *rule, const struct nft_ctx *ctx)
1560+
nf_tables_trans_add(struct nft_ctx *ctx, struct nft_rule *rule)
15611561
{
15621562
struct nft_rule_trans *rupd;
15631563

@@ -1683,7 +1683,7 @@ static int nf_tables_newrule(struct sock *nlsk, struct sk_buff *skb,
16831683

16841684
if (nlh->nlmsg_flags & NLM_F_REPLACE) {
16851685
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);
16871687
if (repl == NULL) {
16881688
err = -ENOMEM;
16891689
goto err2;
@@ -1706,7 +1706,7 @@ static int nf_tables_newrule(struct sock *nlsk, struct sk_buff *skb,
17061706
list_add_rcu(&rule->list, &chain->rules);
17071707
}
17081708

1709-
if (nf_tables_trans_add(rule, &ctx) == NULL) {
1709+
if (nf_tables_trans_add(&ctx, rule) == NULL) {
17101710
err = -ENOMEM;
17111711
goto err3;
17121712
}
@@ -1735,7 +1735,7 @@ nf_tables_delrule_one(struct nft_ctx *ctx, struct nft_rule *rule)
17351735
{
17361736
/* You cannot delete the same rule twice */
17371737
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)
17391739
return -ENOMEM;
17401740
nft_rule_disactivate_next(ctx->net, rule);
17411741
return 0;

0 commit comments

Comments
 (0)