Subject: Re: [PATCH] igmp: fix ip_mc_sf_allow race [v3]

From: Stephen Hemminger <[email-masked]>
Date: Tue, 5 Jan 2010 15:03:04 -0800

On Tue,  5 Jan 2010 18:52:22 -0200
Flavio Leitner <[email-masked]> wrote:

> @@ -2245,13 +2269,17 @@ void ip_mc_drop_socket(struct sock *sk)
>  	struct ip_mc_socklist *iml;
>  	struct net *net = sock_net(sk);
>  
> -	if (inet->mc_list == NULL)
> +	rcu_read_lock();
> +	if (rcu_dereference(inet->mc_list) == NULL) {
> +		rcu_read_unlock();
>  		return;
> +	}
> +	rcu_read_unlock();
>  
>  	rtnl_lock();
> -	while ((iml = i

All this would be cleaner if mc_list was using list_head and the
existing list_head_rcu stuff.

--