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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index b8bd9e014498..d6af466091d2 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -473,11 +473,11 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
473 /* Walk through the bind address list and look for a bind 473 /* Walk through the bind address list and look for a bind
474 * address that matches the source address of the returned dst. 474 * address that matches the source address of the returned dst.
475 */ 475 */
476 sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port));
476 rcu_read_lock(); 477 rcu_read_lock();
477 list_for_each_entry_rcu(laddr, &bp->address_list, list) { 478 list_for_each_entry_rcu(laddr, &bp->address_list, list) {
478 if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC)) 479 if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC))
479 continue; 480 continue;
480 sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port));
481 if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) 481 if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a))
482 goto out_unlock; 482 goto out_unlock;
483 } 483 }
@@ -522,7 +522,8 @@ out:
522/* For v4, the source address is cached in the route entry(dst). So no need 522/* For v4, the source address is cached in the route entry(dst). So no need
523 * to cache it separately and hence this is an empty routine. 523 * to cache it separately and hence this is an empty routine.
524 */ 524 */
525static void sctp_v4_get_saddr(struct sctp_association *asoc, 525static void sctp_v4_get_saddr(struct sctp_sock *sk,
526 struct sctp_association *asoc,
526 struct dst_entry *dst, 527 struct dst_entry *dst,
527 union sctp_addr *daddr, 528 union sctp_addr *daddr,
528 union sctp_addr *saddr) 529 union sctp_addr *saddr)
@@ -619,6 +620,11 @@ static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr)
619 seq_printf(seq, "%d.%d.%d.%d ", NIPQUAD(addr->v4.sin_addr)); 620 seq_printf(seq, "%d.%d.%d.%d ", NIPQUAD(addr->v4.sin_addr));
620} 621}
621 622
623static void sctp_v4_ecn_capable(struct sock *sk)
624{
625 INET_ECN_xmit(sk);
626}
627
622/* Event handler for inet address addition/deletion events. 628/* Event handler for inet address addition/deletion events.
623 * The sctp_local_addr_list needs to be protocted by a spin lock since 629 * The sctp_local_addr_list needs to be protocted by a spin lock since
624 * multiple notifiers (say IPv4 and IPv6) may be running at the same 630 * multiple notifiers (say IPv4 and IPv6) may be running at the same
@@ -937,6 +943,7 @@ static struct sctp_af sctp_af_inet = {
937 .skb_iif = sctp_v4_skb_iif, 943 .skb_iif = sctp_v4_skb_iif,
938 .is_ce = sctp_v4_is_ce, 944 .is_ce = sctp_v4_is_ce,
939 .seq_dump_addr = sctp_v4_seq_dump_addr, 945 .seq_dump_addr = sctp_v4_seq_dump_addr,
946 .ecn_capable = sctp_v4_ecn_capable,
940 .net_header_len = sizeof(struct iphdr), 947 .net_header_len = sizeof(struct iphdr),
941 .sockaddr_len = sizeof(struct sockaddr_in), 948 .sockaddr_len = sizeof(struct sockaddr_in),
942#ifdef CONFIG_COMPAT 949#ifdef CONFIG_COMPAT