diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2020-06-24 17:34:18 -0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-25 16:11:33 -0700 |
commit | 471e39df96b9a4c4ba88a2da9e25a126624d7a9c (patch) | |
tree | a06297f6b1d9cd3faf32b37b95d1fe01191209ed /include/net | |
parent | b6186d413b1d50f45fe2415d760947576ef3691a (diff) | |
download | linux-stable-471e39df96b9a4c4ba88a2da9e25a126624d7a9c.tar.gz linux-stable-471e39df96b9a4c4ba88a2da9e25a126624d7a9c.tar.bz2 linux-stable-471e39df96b9a4c4ba88a2da9e25a126624d7a9c.zip |
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: 1da177e4c3f4 ("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>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sctp/constants.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 15b4d9aec7ff..122d9e2d8dfd 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h @@ -353,11 +353,13 @@ enum { ipv4_is_anycast_6to4(a)) /* Flags used for the bind address copy functions. */ -#define SCTP_ADDR6_ALLOWED 0x00000001 /* IPv6 address is allowed by +#define SCTP_ADDR4_ALLOWED 0x00000001 /* IPv4 address is allowed by local sock family */ -#define SCTP_ADDR4_PEERSUPP 0x00000002 /* IPv4 address is supported by +#define SCTP_ADDR6_ALLOWED 0x00000002 /* IPv6 address is allowed by + local sock family */ +#define SCTP_ADDR4_PEERSUPP 0x00000004 /* IPv4 address is supported by peer */ -#define SCTP_ADDR6_PEERSUPP 0x00000004 /* IPv6 address is supported by +#define SCTP_ADDR6_PEERSUPP 0x00000008 /* IPv6 address is supported by peer */ /* Reasons to retransmit. */ |