Skip to content

Commit 6443bb1

Browse files
Eric Dumazetdavem330
authored andcommitted
ipv6: Fix inet6_csk_bind_conflict()
Commit fda48a0 (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 <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Tested-by: Michael S. Tsirkin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 401da6a commit 6443bb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/inet6_connection_sock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int inet6_csk_bind_conflict(const struct sock *sk,
4848
ipv6_rcv_saddr_equal(sk, sk2))
4949
break;
5050
else if (sk->sk_reuse && sk2->sk_reuse &&
51-
!ipv6_addr_any(inet6_rcv_saddr(sk2)) &&
51+
!ipv6_addr_any(inet6_rcv_saddr(sk)) &&
5252
ipv6_rcv_saddr_equal(sk, sk2))
5353
break;
5454
}

0 commit comments

Comments
 (0)