diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-10-22 12:34:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-23 16:57:14 -0400 |
commit | fecda03493646b53f53892fa3c38c75ba9310374 (patch) | |
tree | 04e1a1ff06f5a7a40b7d546193457942f942fbd8 | |
parent | afb14c7cb66c0401237b181131fd3d6bd4810909 (diff) |
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.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Michio Honda <micchie@sfc.wide.ad.jp>
Acked-by: Michio Honda <micchie@sfc.wide.ad.jp>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sctp/ipv6.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index e7b2d4fe2b6a..96a55910262c 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -279,7 +279,9 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr, | |||
279 | sctp_v6_to_addr(&dst_saddr, &fl6->saddr, htons(bp->port)); | 279 | sctp_v6_to_addr(&dst_saddr, &fl6->saddr, htons(bp->port)); |
280 | rcu_read_lock(); | 280 | rcu_read_lock(); |
281 | list_for_each_entry_rcu(laddr, &bp->address_list, list) { | 281 | list_for_each_entry_rcu(laddr, &bp->address_list, list) { |
282 | if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC)) | 282 | if (!laddr->valid || laddr->state == SCTP_ADDR_DEL || |
283 | (laddr->state != SCTP_ADDR_SRC && | ||
284 | !asoc->src_out_of_asoc_ok)) | ||
283 | continue; | 285 | continue; |
284 | 286 | ||
285 | /* Do not compare against v4 addrs */ | 287 | /* Do not compare against v4 addrs */ |