summaryrefslogtreecommitdiff
path: root/net/netfilter/ipvs/ip_vs_lblc.c
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2011-02-01 17:29:04 (GMT)
committerPatrick McHardy <kaber@trash.net>2011-02-01 17:29:04 (GMT)
commit0443929ff0ecc4d1e690edaffa338cabe0863d3b (patch)
treee2929aa684cbe25525356829bd60c5f5e3119199 /net/netfilter/ipvs/ip_vs_lblc.c
parenta13676476e289ba03a23e27df130c7f33ab00e2f (diff)
downloadlinux-fsl-qoriq-0443929ff0ecc4d1e690edaffa338cabe0863d3b.tar.xz
IPVS: Allow compilation with CONFIG_SYSCTL disabled
This is a rather naieve approach to allowing PVS to compile with CONFIG_SYSCTL disabled. I am working on a more comprehensive patch which will remove compilation of all sysctl-related IPVS code when CONFIG_SYSCTL is disabled. Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Simon Horman <horms@verge.net.au> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Hans Schillstrom <hans@schillstrom.com> Tested-by: Hans Schillstrom <hans@schillstrom.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/ipvs/ip_vs_lblc.c')
-rw-r--r--net/netfilter/ipvs/ip_vs_lblc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index d5bec33..00b5ffa 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -554,33 +554,33 @@ static int __net_init __ip_vs_lblc_init(struct net *net)
sizeof(vs_vars_table),
GFP_KERNEL);
if (ipvs->lblc_ctl_table == NULL)
- goto err_dup;
+ return -ENOMEM;
} else
ipvs->lblc_ctl_table = vs_vars_table;
ipvs->sysctl_lblc_expiration = 24*60*60*HZ;
ipvs->lblc_ctl_table[0].data = &ipvs->sysctl_lblc_expiration;
+#ifdef CONFIG_SYSCTL
ipvs->lblc_ctl_header =
register_net_sysctl_table(net, net_vs_ctl_path,
ipvs->lblc_ctl_table);
- if (!ipvs->lblc_ctl_header)
- goto err_reg;
+ if (!ipvs->lblc_ctl_header) {
+ if (!net_eq(net, &init_net))
+ kfree(ipvs->lblc_ctl_table);
+ return -ENOMEM;
+ }
+#endif
return 0;
-
-err_reg:
- if (!net_eq(net, &init_net))
- kfree(ipvs->lblc_ctl_table);
-
-err_dup:
- return -ENOMEM;
}
static void __net_exit __ip_vs_lblc_exit(struct net *net)
{
struct netns_ipvs *ipvs = net_ipvs(net);
+#ifdef CONFIG_SYSCTL
unregister_net_sysctl_table(ipvs->lblc_ctl_header);
+#endif
if (!net_eq(net, &init_net))
kfree(ipvs->lblc_ctl_table);