diff mbox

[Trusty,SRU] ipv6: Fix regression caused by efe4208 in udp_v6_mcast_next()

Message ID 1403272438-3627-1-git-send-email-tim.gardner@canonical.com
State New
Headers show

Commit Message

Tim Gardner June 20, 2014, 1:53 p.m. UTC
From: Sven Wegener <sven.wegener@stealer.net>

BugLink: http://bugs.launchpad.net/bugs/1332420

Commit efe4208 ("ipv6: make lookups simpler and faster") introduced a
regression in udp_v6_mcast_next(), resulting in multicast packets not
reaching the destination sockets under certain conditions.

The packet's IPv6 addresses are wrongly compared to the IPv6 addresses
from the function's socket argument, which indicates the starting point
for looping, instead of the loop variable. If the addresses from the
first socket do not match the packet's addresses, no socket in the list
will match.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3bfdc59a6c24608ed23e903f670aaf5f58c7a6f3)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 net/ipv6/udp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Tim Gardner June 20, 2014, 2:02 p.m. UTC | #1
Kamal - 3bfdc59a6c24608ed23e903f670aaf5f58c7a6f3 ("ipv6: Fix regression
caused by efe4208 in udp_v6_mcast_next()") was originally marked as a
candidate for stable (patchwork.ozlabs.org/patch/352246), but that does
seem to have made it upstream intact. Please consider for 3.13.y

Perhaps you could hassle Dave Miller about getting it into 3.14.y

rtg
Andy Whitcroft June 20, 2014, 2:50 p.m. UTC | #2
On Fri, Jun 20, 2014 at 07:53:58AM -0600, Tim Gardner wrote:
> From: Sven Wegener <sven.wegener@stealer.net>
> 
> BugLink: http://bugs.launchpad.net/bugs/1332420
> 
> Commit efe4208 ("ipv6: make lookups simpler and faster") introduced a
> regression in udp_v6_mcast_next(), resulting in multicast packets not
> reaching the destination sockets under certain conditions.
> 
> The packet's IPv6 addresses are wrongly compared to the IPv6 addresses
> from the function's socket argument, which indicates the starting point
> for looping, instead of the loop variable. If the addresses from the
> first socket do not match the packet's addresses, no socket in the list
> will match.
> 
> Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
> Acked-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit 3bfdc59a6c24608ed23e903f670aaf5f58c7a6f3)
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>  net/ipv6/udp.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index 411a318..5c31793 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -715,15 +715,15 @@ static struct sock *udp_v6_mcast_next(struct net *net, struct sock *sk,
>  				if (inet->inet_dport != rmt_port)
>  					continue;
>  			}
> -			if (!ipv6_addr_any(&sk->sk_v6_daddr) &&
> -			    !ipv6_addr_equal(&sk->sk_v6_daddr, rmt_addr))
> +			if (!ipv6_addr_any(&s->sk_v6_daddr) &&
> +			    !ipv6_addr_equal(&s->sk_v6_daddr, rmt_addr))
>  				continue;
>  
>  			if (s->sk_bound_dev_if && s->sk_bound_dev_if != dif)
>  				continue;
>  
> -			if (!ipv6_addr_any(&sk->sk_v6_rcv_saddr)) {
> -				if (!ipv6_addr_equal(&sk->sk_v6_rcv_saddr, loc_addr))
> +			if (!ipv6_addr_any(&s->sk_v6_rcv_saddr)) {
> +				if (!ipv6_addr_equal(&s->sk_v6_rcv_saddr, loc_addr))
>  					continue;
>  			}
>  			if (!inet6_mc_check(s, loc_addr, rmt_addr))

Ugg, I see Dave eliminated 's' very soon after this was applied, and a
good thing too.  Looks to do what is claimed, and is an upstream
cherry-pick.  

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw
Tim Gardner June 20, 2014, 3:01 p.m. UTC | #3

Kamal Mostafa June 23, 2014, 3:28 p.m. UTC | #4
On Fri, 2014-06-20 at 08:02 -0600, Tim Gardner wrote:
> Kamal - 3bfdc59a6c24608ed23e903f670aaf5f58c7a6f3 ("ipv6: Fix regression
> caused by efe4208 in udp_v6_mcast_next()") was originally marked as a
> candidate for stable (patchwork.ozlabs.org/patch/352246), but that does
> seem to have made it upstream intact. Please consider for 3.13.y
> 
> Perhaps you could hassle Dave Miller about getting it into 3.14.y
> 
> rtg
> 

Looks like it's already been picked up for 3.14.y and 3.15.y a few days
ago, and I'm queuing it for 3.13.y now.

Thanks Tim!

 -Kamal
diff mbox

Patch

diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 411a318..5c31793 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -715,15 +715,15 @@  static struct sock *udp_v6_mcast_next(struct net *net, struct sock *sk,
 				if (inet->inet_dport != rmt_port)
 					continue;
 			}
-			if (!ipv6_addr_any(&sk->sk_v6_daddr) &&
-			    !ipv6_addr_equal(&sk->sk_v6_daddr, rmt_addr))
+			if (!ipv6_addr_any(&s->sk_v6_daddr) &&
+			    !ipv6_addr_equal(&s->sk_v6_daddr, rmt_addr))
 				continue;
 
 			if (s->sk_bound_dev_if && s->sk_bound_dev_if != dif)
 				continue;
 
-			if (!ipv6_addr_any(&sk->sk_v6_rcv_saddr)) {
-				if (!ipv6_addr_equal(&sk->sk_v6_rcv_saddr, loc_addr))
+			if (!ipv6_addr_any(&s->sk_v6_rcv_saddr)) {
+				if (!ipv6_addr_equal(&s->sk_v6_rcv_saddr, loc_addr))
 					continue;
 			}
 			if (!inet6_mc_check(s, loc_addr, rmt_addr))