|
|
@@ -2218,7 +2218,6 @@ static const struct nf_hook_ops ip_vs_ops[] = {
|
|
|
static int __net_init __ip_vs_init(struct net *net)
|
|
|
{
|
|
|
struct netns_ipvs *ipvs;
|
|
|
- int ret;
|
|
|
|
|
|
ipvs = net_generic(net, ip_vs_net_id);
|
|
|
if (ipvs == NULL)
|
|
|
@@ -2250,17 +2249,11 @@ static int __net_init __ip_vs_init(struct net *net)
|
|
|
if (ip_vs_sync_net_init(ipvs) < 0)
|
|
|
goto sync_fail;
|
|
|
|
|
|
- ret = nf_register_net_hooks(net, ip_vs_ops, ARRAY_SIZE(ip_vs_ops));
|
|
|
- if (ret < 0)
|
|
|
- goto hook_fail;
|
|
|
-
|
|
|
return 0;
|
|
|
/*
|
|
|
* Error handling
|
|
|
*/
|
|
|
|
|
|
-hook_fail:
|
|
|
- ip_vs_sync_net_cleanup(ipvs);
|
|
|
sync_fail:
|
|
|
ip_vs_conn_net_cleanup(ipvs);
|
|
|
conn_fail:
|
|
|
@@ -2290,6 +2283,19 @@ static void __net_exit __ip_vs_cleanup(struct net *net)
|
|
|
net->ipvs = NULL;
|
|
|
}
|
|
|
|
|
|
+static int __net_init __ip_vs_dev_init(struct net *net)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ ret = nf_register_net_hooks(net, ip_vs_ops, ARRAY_SIZE(ip_vs_ops));
|
|
|
+ if (ret < 0)
|
|
|
+ goto hook_fail;
|
|
|
+ return 0;
|
|
|
+
|
|
|
+hook_fail:
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
static void __net_exit __ip_vs_dev_cleanup(struct net *net)
|
|
|
{
|
|
|
struct netns_ipvs *ipvs = net_ipvs(net);
|
|
|
@@ -2309,6 +2315,7 @@ static struct pernet_operations ipvs_core_ops = {
|
|
|
};
|
|
|
|
|
|
static struct pernet_operations ipvs_core_dev_ops = {
|
|
|
+ .init = __ip_vs_dev_init,
|
|
|
.exit = __ip_vs_dev_cleanup,
|
|
|
};
|
|
|
|