Skip to content

Commit

Permalink
ipvs: reset ipvs pointer in netns
Browse files Browse the repository at this point in the history
	Make sure net->ipvs is reset on netns cleanup or failed
initialization. It is needed for IPVS applications to know that
IPVS core is not loaded in netns.

Signed-off-by: Julian Anastasov <[email protected]>
Acked-by: Hans Schillstrom <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
Julian Anastasov authored and horms committed Apr 26, 2012
1 parent 8d08d71 commit 39f618b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/netfilter/ipvs/ip_vs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,7 @@ static int __net_init __ip_vs_init(struct net *net)
control_fail:
ip_vs_estimator_net_cleanup(net);
estimator_fail:
net->ipvs = NULL;
return -ENOMEM;
}

Expand All @@ -1936,6 +1937,7 @@ static void __net_exit __ip_vs_cleanup(struct net *net)
ip_vs_control_net_cleanup(net);
ip_vs_estimator_net_cleanup(net);
IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen);
net->ipvs = NULL;
}

static void __net_exit __ip_vs_dev_cleanup(struct net *net)
Expand Down

0 comments on commit 39f618b

Please sign in to comment.