File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -2245,7 +2245,6 @@ static const struct nf_hook_ops ip_vs_ops[] = {
2245
2245
static int __net_init __ip_vs_init (struct net * net )
2246
2246
{
2247
2247
struct netns_ipvs * ipvs ;
2248
- int ret ;
2249
2248
2250
2249
ipvs = net_generic (net , ip_vs_net_id );
2251
2250
if (ipvs == NULL )
@@ -2277,17 +2276,11 @@ static int __net_init __ip_vs_init(struct net *net)
2277
2276
if (ip_vs_sync_net_init (ipvs ) < 0 )
2278
2277
goto sync_fail ;
2279
2278
2280
- ret = nf_register_net_hooks (net , ip_vs_ops , ARRAY_SIZE (ip_vs_ops ));
2281
- if (ret < 0 )
2282
- goto hook_fail ;
2283
-
2284
2279
return 0 ;
2285
2280
/*
2286
2281
* Error handling
2287
2282
*/
2288
2283
2289
- hook_fail :
2290
- ip_vs_sync_net_cleanup (ipvs );
2291
2284
sync_fail :
2292
2285
ip_vs_conn_net_cleanup (ipvs );
2293
2286
conn_fail :
@@ -2317,6 +2310,19 @@ static void __net_exit __ip_vs_cleanup(struct net *net)
2317
2310
net -> ipvs = NULL ;
2318
2311
}
2319
2312
2313
+ static int __net_init __ip_vs_dev_init (struct net * net )
2314
+ {
2315
+ int ret ;
2316
+
2317
+ ret = nf_register_net_hooks (net , ip_vs_ops , ARRAY_SIZE (ip_vs_ops ));
2318
+ if (ret < 0 )
2319
+ goto hook_fail ;
2320
+ return 0 ;
2321
+
2322
+ hook_fail :
2323
+ return ret ;
2324
+ }
2325
+
2320
2326
static void __net_exit __ip_vs_dev_cleanup (struct net * net )
2321
2327
{
2322
2328
struct netns_ipvs * ipvs = net_ipvs (net );
@@ -2336,6 +2342,7 @@ static struct pernet_operations ipvs_core_ops = {
2336
2342
};
2337
2343
2338
2344
static struct pernet_operations ipvs_core_dev_ops = {
2345
+ .init = __ip_vs_dev_init ,
2339
2346
.exit = __ip_vs_dev_cleanup ,
2340
2347
};
2341
2348
You can’t perform that action at this time.
0 commit comments