net: sctp: fix ASCONF to allow non SCTP_ADDR_SRC addresses in ipv6
Subsystems (3)
PATCH 1/1 net: sctp: fix ASCONF to allow non SCTP_ADDR_SRC addresses in ipv6
Commit 8a07eb0a50 ("sctp: Add ASCONF operation on the single-homed host") implemented possible use of IPv4 addresses with non SCTP_ADDR_SRC state as source address when sending ASCONF (ADD) packets, but IPv6 part for that was not implemented in 8a07eb0a50. Therefore, as this is not restricted to IPv4-only, fix this up to allow the same for IPv6 addresses in SCTP.
--- net/sctp/ipv6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/sctp/ipv6.c +3 -1
@@ -279,7 +279,9 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,sctp_v6_to_addr (&dst_saddr, &fl6->saddr,htons (bp->port));rcu_read_lock ();list_for_each_entry_rcu (laddr, &bp->address_list, list) { -if (!laddr->valid || (laddr->state !=SCTP_ADDR_SRC )) +if (!laddr->valid || laddr->state =SCTP_ADDR_DEL || + (laddr->state !=SCTP_ADDR_SRC && + !asoc->src_out_of_asoc_ok))continue ;/* Do not compare against v4 addrs */
Signature · 1 line
1.8.3.1
Quoted 29 lines · Daniel Borkmann
Commit
8a07eb0a50("sctp: Add ASCONF operation on the single-homed host") implemented possible use of IPv4 addresses with nonSCTP_ADDR_SRCstate as source address when sending ASCONF (ADD) packets, but IPv6 part for that was not implemented in8a07eb0a50. Therefore, as this is not restricted to IPv4-only, fix this up to allow the same for IPv6 addresses in SCTP.Signed-off-by Daniel Borkmann <[email protected]>Cc Michio Honda <[email protected]>---
net/sctp/ipv6.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)net/sctp/ipv6.c +3
-1@@ -279,7 +279,9 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,sctp_v6_to_addr (&dst_saddr, &fl6->saddr,htons (bp->port));rcu_read_lock ();list_for_each_entry_rcu (laddr, &bp->address_list, list) { -if (!laddr->valid || (laddr->state !=SCTP_ADDR_SRC )) +if (!laddr->valid || laddr->state =SCTP_ADDR_DEL || + (laddr->state !=SCTP_ADDR_SRC && + !asoc->src_out_of_asoc_ok))continue ;/* Do not compare against v4 addrs */ Signature · 1 line
1.8.3.1
Quoted 9 lines · Daniel Borkmann
Commit
8a07eb0a50("sctp: Add ASCONF operation on the single-homed host") implemented possible use of IPv4 addresses with nonSCTP_ADDR_SRCstate as source address when sending ASCONF (ADD) packets, but IPv6 part for that was not implemented in8a07eb0a50. Therefore, as this is not restricted to IPv4-only, fix this up to allow the same for IPv6 addresses in SCTP.Signed-off-by Daniel Borkmann <[email protected]>Cc Michio Honda <[email protected]>
[stupid gmail]
Quoted 26 lines
--- net/sctp/ipv6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)net/sctp/ipv6.c +3
-2@@ -279,7 +279,9 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,sctp_v6_to_addr (&dst_saddr, &fl6->saddr,htons (bp->port));rcu_read_lock ();list_for_each_entry_rcu (laddr, &bp->address_list, list) { -if (!laddr->valid || (laddr->state !=SCTP_ADDR_SRC )) +if (!laddr->valid || laddr->state =SCTP_ADDR_DEL || + (laddr->state !=SCTP_ADDR_SRC && + !asoc->src_out_of_asoc_ok))continue ;/* Do not compare against v4 addrs */ --1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 35 lines · Daniel Borkmann
Commit
8a07eb0a50("sctp: Add ASCONF operation on the single-homed host") implemented possible use of IPv4 addresses with nonSCTP_ADDR_SRCstate as source address when sending ASCONF (ADD) packets, but IPv6 part for that was not implemented in8a07eb0a50. Therefore, as this is not restricted to IPv4-only, fix this up to allow the same for IPv6 addresses in SCTP.Signed-off-by Daniel Borkmann <[email protected]>Cc Michio Honda <[email protected]>--- net/sctp/ipv6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)net/sctp/ipv6.c +3
-1@@ -279,7 +279,9 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,sctp_v6_to_addr (&dst_saddr, &fl6->saddr,htons (bp->port));rcu_read_lock ();list_for_each_entry_rcu (laddr, &bp->address_list, list) { -if (!laddr->valid || (laddr->state !=SCTP_ADDR_SRC )) +if (!laddr->valid || laddr->state =SCTP_ADDR_DEL || + (laddr->state !=SCTP_ADDR_SRC && + !asoc->src_out_of_asoc_ok))continue ;/* Do not compare against v4 addrs */ Signature · 6 lines
1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Daniel Borkmann <[email protected]>
Date: Tue, 22 Oct 2013 18:34:56 +0200
Quoted 8 lines
Commit
8a07eb0a50("sctp: Add ASCONF operation on the single-homed host") implemented possible use of IPv4 addresses with nonSCTP_ADDR_SRCstate as source address when sending ASCONF (ADD) packets, but IPv6 part for that was not implemented in8a07eb0a50. Therefore, as this is not restricted to IPv4-only, fix this up to allow the same for IPv6 addresses in SCTP.Signed-off-by Daniel Borkmann <[email protected]>Cc Michio Honda <[email protected]>
Applied, thanks.