ipvs: null check of net->ipvs in lblc(r) shedulers
Avoid crash when registering shedulers after the IPVS core initialization for netns fails. Do this by checking for present core (net->ipvs). Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
parent
39f618b4fd
commit
4b984cd50b
2 changed files with 6 additions and 0 deletions
|
@ -551,6 +551,9 @@ static int __net_init __ip_vs_lblc_init(struct net *net)
|
|||
{
|
||||
struct netns_ipvs *ipvs = net_ipvs(net);
|
||||
|
||||
if (!ipvs)
|
||||
return -ENOENT;
|
||||
|
||||
if (!net_eq(net, &init_net)) {
|
||||
ipvs->lblc_ctl_table = kmemdup(vs_vars_table,
|
||||
sizeof(vs_vars_table),
|
||||
|
|
|
@ -745,6 +745,9 @@ static int __net_init __ip_vs_lblcr_init(struct net *net)
|
|||
{
|
||||
struct netns_ipvs *ipvs = net_ipvs(net);
|
||||
|
||||
if (!ipvs)
|
||||
return -ENOENT;
|
||||
|
||||
if (!net_eq(net, &init_net)) {
|
||||
ipvs->lblcr_ctl_table = kmemdup(vs_vars_table,
|
||||
sizeof(vs_vars_table),
|
||||
|
|
Loading…
Reference in a new issue