sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket
If a socket is set ipv6only, it will still send IPv4 addresses in the
INIT and INIT_ACK packets. This potentially misleads the peer into using
them, which then would cause association termination.
The fix is to not add IPv4 addresses to ipv6only sockets.
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Tested-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
b6186d413b
commit
471e39df96
@@ -461,6 +461,7 @@ static int sctp_copy_one_addr(struct net *net, struct sctp_bind_addr *dest,
|
||||
* well as the remote peer.
|
||||
*/
|
||||
if ((((AF_INET == addr->sa.sa_family) &&
|
||||
(flags & SCTP_ADDR4_ALLOWED) &&
|
||||
(flags & SCTP_ADDR4_PEERSUPP))) ||
|
||||
(((AF_INET6 == addr->sa.sa_family) &&
|
||||
(flags & SCTP_ADDR6_ALLOWED) &&
|
||||
|
||||
Reference in New Issue
Block a user