fib6: install fib6 ops in the last step
Subsystems (3)
PATCH 1/2 fib6: install fib6 ops in the last step
We should not commit the new ops until we finish all the setup, otherwise we have to NULL it on failure.
--- net/ipv6/fib6_rules.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
net/ipv6/fib6_rules.c +3 -6
@@ -299,19 +299,16 @@ static int __net_init fib6_rules_net_init(struct net *net) ops =fib_rules_register (&fib6_rules_ops_template, net);if (IS_ERR (ops))return PTR_ERR (ops); - net->ipv6.fib6_rules_ops = ops; - - err =fib_default_rule_add (net->ipv6.fib6_rules_ops,0 , -RT6_TABLE_LOCAL ,0 ); + err =fib_default_rule_add (ops,0 ,RT6_TABLE_LOCAL ,0 );if (err) goto out_fib6_rules_ops; - err =fib_default_rule_add (net->ipv6.fib6_rules_ops, -0x7FFE ,RT6_TABLE_MAIN ,0 ); + err =fib_default_rule_add (ops,0x7FFE ,RT6_TABLE_MAIN ,0 );if (err) goto out_fib6_rules_ops; + net->ipv6.fib6_rules_ops = ops; out:return err;
Signature · 1 line
1.8.3.1
PATCH 2/2 ipmr,ip6mr: call ip6mr_free_table() on failure path
--- net/ipv4/ipmr.c | 2 +- net/ipv6/ip6mr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/ipmr.c +1 -1
@@ -268,7 +268,7 @@ static int __net_init ipmr_rules_init(struct net *net)return 0 ; err2: -kfree (mrt); +ipmr_free_table (mrt); err1:fib_rules_unregister (ops);return err;
net/ipv6/ip6mr.c +1 -1
@@ -252,7 +252,7 @@ static int __net_init ip6mr_rules_init(struct net *net)return 0 ; err2: -kfree (mrt); +ip6mr_free_table (mrt); err1:fib_rules_unregister (ops);return err;
Signature · 1 line
1.8.3.1
Re: [Patch net 2/2] ipmr,ip6mr: call ip6mr_free_table() on failure path
From: Cong Wang <[email protected]>
Date: Wed, 25 Mar 2015 14:45:03 -0700
Quoted 1 line
Signed-off-by Cong Wang <[email protected]>
Applied to net.
Quoted 3 lines · Cong Wang
We should not commit the new ops until we finish all the setup, otherwise we have to NULL it on failure.
I messed up my net branch with net-next, so this single patch actually doesn't fix any bug so can be just targeted for net-next.
Let me know if you want me to resend.
From: Cong Wang <[email protected]>
Date: Wed, 25 Mar 2015 14:45:02 -0700
Quoted 4 lines
We should not commit the new ops until we finish all the setup, otherwise we have to NULL it on failure.
Signed-off-by Cong Wang <[email protected]>
Applied to net-next