diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 816c033d7886..1ab03a27a76e 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -240,7 +240,7 @@ int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope, | |||
240 | (((AF_INET6 == addr->a.sa.sa_family) && | 240 | (((AF_INET6 == addr->a.sa.sa_family) && |
241 | (copy_flags & SCTP_ADDR6_ALLOWED) && | 241 | (copy_flags & SCTP_ADDR6_ALLOWED) && |
242 | (copy_flags & SCTP_ADDR6_PEERSUPP)))) { | 242 | (copy_flags & SCTP_ADDR6_PEERSUPP)))) { |
243 | error = sctp_add_bind_addr(bp, &addr->a, | 243 | error = sctp_add_bind_addr(bp, &addr->a, 1, |
244 | GFP_ATOMIC); | 244 | GFP_ATOMIC); |
245 | if (error) | 245 | if (error) |
246 | goto end_copy; | 246 | goto end_copy; |
@@ -486,6 +486,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, | |||
486 | list_for_each(pos, &bp->address_list) { | 486 | list_for_each(pos, &bp->address_list) { |
487 | laddr = list_entry(pos, struct sctp_sockaddr_entry, | 487 | laddr = list_entry(pos, struct sctp_sockaddr_entry, |
488 | list); | 488 | list); |
489 | if (!laddr->use_as_src) | ||
490 | continue; | ||
489 | sctp_v4_dst_saddr(&dst_saddr, dst, bp->port); | 491 | sctp_v4_dst_saddr(&dst_saddr, dst, bp->port); |
490 | if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) | 492 | if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) |
491 | goto out_unlock; | 493 | goto out_unlock; |
@@ -506,7 +508,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, | |||
506 | list_for_each(pos, &bp->address_list) { | 508 | list_for_each(pos, &bp->address_list) { |
507 | laddr = list_entry(pos, struct sctp_sockaddr_entry, list); | 509 | laddr = list_entry(pos, struct sctp_sockaddr_entry, list); |
508 | 510 | ||
509 | if (AF_INET == laddr->a.sa.sa_family) { | 511 | if ((laddr->use_as_src) && |
512 | (AF_INET == laddr->a.sa.sa_family)) { | ||
510 | fl.fl4_src = laddr->a.v4.sin_addr.s_addr; | 513 | fl.fl4_src = laddr->a.v4.sin_addr.s_addr; |
511 | if (!ip_route_output_key(&rt, &fl)) { | 514 | if (!ip_route_output_key(&rt, &fl)) { |
512 | dst = &rt->u.dst; | 515 | dst = &rt->u.dst; |