Re: [PATCH 1/2] ipvs: reset ipvs pointer in netns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Julian
On Friday 13 April 2012 10:44:01 Julian Anastasov wrote:
> 	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 <ja@xxxxxx>
> ---
>  net/netfilter/ipvs/ip_vs_core.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index 2555816..260b9ef 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1924,6 +1924,7 @@ protocol_fail:
>  control_fail:
>  	ip_vs_estimator_net_cleanup(net);
>  estimator_fail:
> +	net->ipvs = NULL;

You can't do this since name space cleanup will call __ip_vs_cleanup later
and that will cause  NULL pointer problems


Note that any netns init faiulure will be rolled back later by net_namespace.c
And you will not receive any trafic into a namepace until all init is OK


>  	return -ENOMEM;
>  }
>  
> @@ -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)

-- 
Regards
Hans Schillstrom <hans.schillstrom@xxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Devel]     [Linux NFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [X.Org]

  Powered by Linux