aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/protocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r--net/sctp/protocol.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index dc22d7108494..e466e00b9a9f 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -229,8 +229,8 @@ int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope,
229 (((AF_INET6 == addr->a.sa.sa_family) && 229 (((AF_INET6 == addr->a.sa.sa_family) &&
230 (copy_flags & SCTP_ADDR6_ALLOWED) && 230 (copy_flags & SCTP_ADDR6_ALLOWED) &&
231 (copy_flags & SCTP_ADDR6_PEERSUPP)))) { 231 (copy_flags & SCTP_ADDR6_PEERSUPP)))) {
232 error = sctp_add_bind_addr(bp, &addr->a, 1, 232 error = sctp_add_bind_addr(bp, &addr->a,
233 GFP_ATOMIC); 233 SCTP_ADDR_SRC, GFP_ATOMIC);
234 if (error) 234 if (error)
235 goto end_copy; 235 goto end_copy;
236 } 236 }
@@ -472,7 +472,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
472 */ 472 */
473 rcu_read_lock(); 473 rcu_read_lock();
474 list_for_each_entry_rcu(laddr, &bp->address_list, list) { 474 list_for_each_entry_rcu(laddr, &bp->address_list, list) {
475 if (!laddr->valid || !laddr->use_as_src) 475 if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC))
476 continue; 476 continue;
477 sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port)); 477 sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port));
478 if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) 478 if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a))
@@ -494,7 +494,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
494 list_for_each_entry_rcu(laddr, &bp->address_list, list) { 494 list_for_each_entry_rcu(laddr, &bp->address_list, list) {
495 if (!laddr->valid) 495 if (!laddr->valid)
496 continue; 496 continue;
497 if ((laddr->use_as_src) && 497 if ((laddr->state == SCTP_ADDR_SRC) &&
498 (AF_INET == laddr->a.sa.sa_family)) { 498 (AF_INET == laddr->a.sa.sa_family)) {
499 fl.fl4_src = laddr->a.v4.sin_addr.s_addr; 499 fl.fl4_src = laddr->a.v4.sin_addr.s_addr;
500 if (!ip_route_output_key(&rt, &fl)) { 500 if (!ip_route_output_key(&rt, &fl)) {