ipv6: Fix inet6_csk_bind_conflict()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Sunday, April 25, 2010 - 4:59 pm

Gitweb:     http://git.kernel.org/linus/6443bb1fc2050ca2b6585a3fa77f7833b55329ed
Commit:     6443bb1fc2050ca2b6585a3fa77f7833b55329ed
Parent:     401da6aea31ef69c2fcd260382adabdcf7ce820a
Author:     Eric Dumazet <eric.dumazet@gmail.com>
AuthorDate: Sun Apr 25 15:09:42 2010 -0700
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Sun Apr 25 15:09:42 2010 -0700

    ipv6: Fix inet6_csk_bind_conflict()
    
    Commit fda48a0d7a84 (tcp: bind() fix when many ports are bound)
    introduced a bug on IPV6 part.
    We should not call ipv6_addr_any(inet6_rcv_saddr(sk2)) but
    ipv6_addr_any(inet6_rcv_saddr(sk)) because sk2 can be IPV4, while sk is
    IPV6.
    
    Reported-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Tested-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv6/inet6_connection_sock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index b4b7d40..3a4d92b 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -48,7 +48,7 @@ int inet6_csk_bind_conflict(const struct sock *sk,
 			     ipv6_rcv_saddr_equal(sk, sk2))
 				break;
 			else if (sk->sk_reuse && sk2->sk_reuse &&
-				!ipv6_addr_any(inet6_rcv_saddr(sk2)) &&
+				!ipv6_addr_any(inet6_rcv_saddr(sk)) &&
 				ipv6_rcv_saddr_equal(sk, sk2))
 				break;
 		}
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ipv6: Fix inet6_csk_bind_conflict(), Linux Kernel Mailing ..., (Sun Apr 25, 4:59 pm)