diff options
author | Hans Schillstrom <hans.schillstrom@ericsson.com> | 2012-04-26 09:45:34 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-04-30 10:40:14 +0200 |
commit | 4b984cd50bc1b6d492175cd77bfabb78e76ffa67 (patch) | |
tree | f338dce013046c295f177ad190cd5c88040ee8cf /net/netfilter/ipvs/ip_vs_lblc.c | |
parent | 39f618b4fd95ae243d940ec64c961009c74e3333 (diff) |
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>
Diffstat (limited to 'net/netfilter/ipvs/ip_vs_lblc.c')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_lblc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index 0f16283fd058..caa43704e55e 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c @@ -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), |