aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/protocol.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-08 01:47:47 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 01:47:47 -0400
commit93022136fff9e6130aa128a5ed8a599e93ac813c (patch)
tree185390fb75a3d7423cc508610b76637c957205b9 /net/sctp/protocol.c
parentc49c412a47b5102516d3313d4eba38cb1e968721 (diff)
parentb7279469d66b55119784b8b9529c99c1955fe747 (diff)
Merge commit 'v2.6.26-rc9' into x86/cpu
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r--net/sctp/protocol.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 0ec234b762c2..9258dfe784ae 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -108,14 +108,23 @@ static __init int sctp_proc_init(void)
108 } 108 }
109 109
110 if (sctp_snmp_proc_init()) 110 if (sctp_snmp_proc_init())
111 goto out_nomem; 111 goto out_snmp_proc_init;
112 if (sctp_eps_proc_init()) 112 if (sctp_eps_proc_init())
113 goto out_nomem; 113 goto out_eps_proc_init;
114 if (sctp_assocs_proc_init()) 114 if (sctp_assocs_proc_init())
115 goto out_nomem; 115 goto out_assocs_proc_init;
116 116
117 return 0; 117 return 0;
118 118
119out_assocs_proc_init:
120 sctp_eps_proc_exit();
121out_eps_proc_init:
122 sctp_snmp_proc_exit();
123out_snmp_proc_init:
124 if (proc_net_sctp) {
125 proc_net_sctp = NULL;
126 remove_proc_entry("sctp", init_net.proc_net);
127 }
119out_nomem: 128out_nomem:
120 return -ENOMEM; 129 return -ENOMEM;
121} 130}
@@ -470,11 +479,11 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
470 /* Walk through the bind address list and look for a bind 479 /* Walk through the bind address list and look for a bind
471 * address that matches the source address of the returned dst. 480 * address that matches the source address of the returned dst.
472 */ 481 */
482 sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port));
473 rcu_read_lock(); 483 rcu_read_lock();
474 list_for_each_entry_rcu(laddr, &bp->address_list, list) { 484 list_for_each_entry_rcu(laddr, &bp->address_list, list) {
475 if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC)) 485 if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC))
476 continue; 486 continue;
477 sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port));
478 if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) 487 if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a))
479 goto out_unlock; 488 goto out_unlock;
480 } 489 }
@@ -519,7 +528,8 @@ out:
519/* For v4, the source address is cached in the route entry(dst). So no need 528/* For v4, the source address is cached in the route entry(dst). So no need
520 * to cache it separately and hence this is an empty routine. 529 * to cache it separately and hence this is an empty routine.
521 */ 530 */
522static void sctp_v4_get_saddr(struct sctp_association *asoc, 531static void sctp_v4_get_saddr(struct sctp_sock *sk,
532 struct sctp_association *asoc,
523 struct dst_entry *dst, 533 struct dst_entry *dst,
524 union sctp_addr *daddr, 534 union sctp_addr *daddr,
525 union sctp_addr *saddr) 535 union sctp_addr *saddr)
@@ -616,6 +626,11 @@ static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr)
616 seq_printf(seq, "%d.%d.%d.%d ", NIPQUAD(addr->v4.sin_addr)); 626 seq_printf(seq, "%d.%d.%d.%d ", NIPQUAD(addr->v4.sin_addr));
617} 627}
618 628
629static void sctp_v4_ecn_capable(struct sock *sk)
630{
631 INET_ECN_xmit(sk);
632}
633
619/* Event handler for inet address addition/deletion events. 634/* Event handler for inet address addition/deletion events.
620 * The sctp_local_addr_list needs to be protocted by a spin lock since 635 * The sctp_local_addr_list needs to be protocted by a spin lock since
621 * multiple notifiers (say IPv4 and IPv6) may be running at the same 636 * multiple notifiers (say IPv4 and IPv6) may be running at the same
@@ -934,6 +949,7 @@ static struct sctp_af sctp_af_inet = {
934 .skb_iif = sctp_v4_skb_iif, 949 .skb_iif = sctp_v4_skb_iif,
935 .is_ce = sctp_v4_is_ce, 950 .is_ce = sctp_v4_is_ce,
936 .seq_dump_addr = sctp_v4_seq_dump_addr, 951 .seq_dump_addr = sctp_v4_seq_dump_addr,
952 .ecn_capable = sctp_v4_ecn_capable,
937 .net_header_len = sizeof(struct iphdr), 953 .net_header_len = sizeof(struct iphdr),
938 .sockaddr_len = sizeof(struct sockaddr_in), 954 .sockaddr_len = sizeof(struct sockaddr_in),
939#ifdef CONFIG_COMPAT 955#ifdef CONFIG_COMPAT