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
|
@ -551,6 +551,9 @@ static int __net_init __ip_vs_lblc_init(struct net *net)
|
||||||
{
|
{
|
||||||
struct netns_ipvs *ipvs = net_ipvs(net);
|
struct netns_ipvs *ipvs = net_ipvs(net);
|
||||||
|
|
||||||
|
if (!ipvs)
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
if (!net_eq(net, &init_net)) {
|
if (!net_eq(net, &init_net)) {
|
||||||
ipvs->lblc_ctl_table = kmemdup(vs_vars_table,
|
ipvs->lblc_ctl_table = kmemdup(vs_vars_table,
|
||||||
sizeof(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);
|
struct netns_ipvs *ipvs = net_ipvs(net);
|
||||||
|
|
||||||
|
if (!ipvs)
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
if (!net_eq(net, &init_net)) {
|
if (!net_eq(net, &init_net)) {
|
||||||
ipvs->lblcr_ctl_table = kmemdup(vs_vars_table,
|
ipvs->lblcr_ctl_table = kmemdup(vs_vars_table,
|
||||||
sizeof(vs_vars_table),
|
sizeof(vs_vars_table),
|
||||||
|
|
Loading…
Reference in New Issue