Skip to content

Commit

Permalink
ipvs: null check of net->ipvs in lblc(r) shedulers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Julian Anastasov <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
Hans Schillstrom authored and ummakynes committed Apr 30, 2012
1 parent 39f618b commit 4b984cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/netfilter/ipvs/ip_vs_lblc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
3 changes: 3 additions & 0 deletions net/netfilter/ipvs/ip_vs_lblcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 4b984cd

Please sign in to comment.