diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 612dc878e05c..a56f98e82f92 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #include <linux/bootmem.h> | 54 | #include <linux/bootmem.h> |
55 | #include <linux/highmem.h> | 55 | #include <linux/highmem.h> |
56 | #include <linux/swap.h> | 56 | #include <linux/swap.h> |
57 | #include <linux/slab.h> | ||
57 | #include <net/net_namespace.h> | 58 | #include <net/net_namespace.h> |
58 | #include <net/protocol.h> | 59 | #include <net/protocol.h> |
59 | #include <net/ip.h> | 60 | #include <net/ip.h> |
@@ -188,7 +189,6 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist, | |||
188 | addr->a.v4.sin_addr.s_addr = ifa->ifa_local; | 189 | addr->a.v4.sin_addr.s_addr = ifa->ifa_local; |
189 | addr->valid = 1; | 190 | addr->valid = 1; |
190 | INIT_LIST_HEAD(&addr->list); | 191 | INIT_LIST_HEAD(&addr->list); |
191 | INIT_RCU_HEAD(&addr->rcu); | ||
192 | list_add_tail(&addr->list, addrlist); | 192 | list_add_tail(&addr->list, addrlist); |
193 | } | 193 | } |
194 | } | 194 | } |
@@ -205,14 +205,14 @@ static void sctp_get_local_addr_list(void) | |||
205 | struct list_head *pos; | 205 | struct list_head *pos; |
206 | struct sctp_af *af; | 206 | struct sctp_af *af; |
207 | 207 | ||
208 | read_lock(&dev_base_lock); | 208 | rcu_read_lock(); |
209 | for_each_netdev(&init_net, dev) { | 209 | for_each_netdev_rcu(&init_net, dev) { |
210 | __list_for_each(pos, &sctp_address_families) { | 210 | __list_for_each(pos, &sctp_address_families) { |
211 | af = list_entry(pos, struct sctp_af, list); | 211 | af = list_entry(pos, struct sctp_af, list); |
212 | af->copy_addrlist(&sctp_local_addr_list, dev); | 212 | af->copy_addrlist(&sctp_local_addr_list, dev); |
213 | } | 213 | } |
214 | } | 214 | } |
215 | read_unlock(&dev_base_lock); | 215 | rcu_read_unlock(); |
216 | } | 216 | } |
217 | 217 | ||
218 | /* Free the existing local addresses. */ | 218 | /* Free the existing local addresses. */ |
@@ -296,19 +296,19 @@ static void sctp_v4_from_sk(union sctp_addr *addr, struct sock *sk) | |||
296 | { | 296 | { |
297 | addr->v4.sin_family = AF_INET; | 297 | addr->v4.sin_family = AF_INET; |
298 | addr->v4.sin_port = 0; | 298 | addr->v4.sin_port = 0; |
299 | addr->v4.sin_addr.s_addr = inet_sk(sk)->rcv_saddr; | 299 | addr->v4.sin_addr.s_addr = inet_sk(sk)->inet_rcv_saddr; |
300 | } | 300 | } |
301 | 301 | ||
302 | /* Initialize sk->sk_rcv_saddr from sctp_addr. */ | 302 | /* Initialize sk->sk_rcv_saddr from sctp_addr. */ |
303 | static void sctp_v4_to_sk_saddr(union sctp_addr *addr, struct sock *sk) | 303 | static void sctp_v4_to_sk_saddr(union sctp_addr *addr, struct sock *sk) |
304 | { | 304 | { |
305 | inet_sk(sk)->rcv_saddr = addr->v4.sin_addr.s_addr; | 305 | inet_sk(sk)->inet_rcv_saddr = addr->v4.sin_addr.s_addr; |
306 | } | 306 | } |
307 | 307 | ||
308 | /* Initialize sk->sk_daddr from sctp_addr. */ | 308 | /* Initialize sk->sk_daddr from sctp_addr. */ |
309 | static void sctp_v4_to_sk_daddr(union sctp_addr *addr, struct sock *sk) | 309 | static void sctp_v4_to_sk_daddr(union sctp_addr *addr, struct sock *sk) |
310 | { | 310 | { |
311 | inet_sk(sk)->daddr = addr->v4.sin_addr.s_addr; | 311 | inet_sk(sk)->inet_daddr = addr->v4.sin_addr.s_addr; |
312 | } | 312 | } |
313 | 313 | ||
314 | /* Initialize a sctp_addr from an address parameter. */ | 314 | /* Initialize a sctp_addr from an address parameter. */ |
@@ -598,7 +598,7 @@ static struct sock *sctp_v4_create_accept_sk(struct sock *sk, | |||
598 | 598 | ||
599 | newinet = inet_sk(newsk); | 599 | newinet = inet_sk(newsk); |
600 | 600 | ||
601 | newinet->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr; | 601 | newinet->inet_daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr; |
602 | 602 | ||
603 | sk_refcnt_debug_inc(newsk); | 603 | sk_refcnt_debug_inc(newsk); |
604 | 604 | ||
@@ -909,7 +909,6 @@ static struct inet_protosw sctp_seqpacket_protosw = { | |||
909 | .protocol = IPPROTO_SCTP, | 909 | .protocol = IPPROTO_SCTP, |
910 | .prot = &sctp_prot, | 910 | .prot = &sctp_prot, |
911 | .ops = &inet_seqpacket_ops, | 911 | .ops = &inet_seqpacket_ops, |
912 | .capability = -1, | ||
913 | .no_check = 0, | 912 | .no_check = 0, |
914 | .flags = SCTP_PROTOSW_FLAG | 913 | .flags = SCTP_PROTOSW_FLAG |
915 | }; | 914 | }; |
@@ -918,7 +917,6 @@ static struct inet_protosw sctp_stream_protosw = { | |||
918 | .protocol = IPPROTO_SCTP, | 917 | .protocol = IPPROTO_SCTP, |
919 | .prot = &sctp_prot, | 918 | .prot = &sctp_prot, |
920 | .ops = &inet_seqpacket_ops, | 919 | .ops = &inet_seqpacket_ops, |
921 | .capability = -1, | ||
922 | .no_check = 0, | 920 | .no_check = 0, |
923 | .flags = SCTP_PROTOSW_FLAG | 921 | .flags = SCTP_PROTOSW_FLAG |
924 | }; | 922 | }; |
@@ -998,12 +996,13 @@ int sctp_register_pf(struct sctp_pf *pf, sa_family_t family) | |||
998 | 996 | ||
999 | static inline int init_sctp_mibs(void) | 997 | static inline int init_sctp_mibs(void) |
1000 | { | 998 | { |
1001 | return snmp_mib_init((void**)sctp_statistics, sizeof(struct sctp_mib)); | 999 | return snmp_mib_init((void __percpu **)sctp_statistics, |
1000 | sizeof(struct sctp_mib)); | ||
1002 | } | 1001 | } |
1003 | 1002 | ||
1004 | static inline void cleanup_sctp_mibs(void) | 1003 | static inline void cleanup_sctp_mibs(void) |
1005 | { | 1004 | { |
1006 | snmp_mib_free((void**)sctp_statistics); | 1005 | snmp_mib_free((void __percpu **)sctp_statistics); |
1007 | } | 1006 | } |
1008 | 1007 | ||
1009 | static void sctp_v4_pf_init(void) | 1008 | static void sctp_v4_pf_init(void) |
@@ -1260,6 +1259,9 @@ SCTP_STATIC __init int sctp_init(void) | |||
1260 | /* Set SCOPE policy to enabled */ | 1259 | /* Set SCOPE policy to enabled */ |
1261 | sctp_scope_policy = SCTP_SCOPE_POLICY_ENABLE; | 1260 | sctp_scope_policy = SCTP_SCOPE_POLICY_ENABLE; |
1262 | 1261 | ||
1262 | /* Set the default rwnd update threshold */ | ||
1263 | sctp_rwnd_upd_shift = SCTP_DEFAULT_RWND_SHIFT; | ||
1264 | |||
1263 | sctp_sysctl_register(); | 1265 | sctp_sysctl_register(); |
1264 | 1266 | ||
1265 | INIT_LIST_HEAD(&sctp_address_families); | 1267 | INIT_LIST_HEAD(&sctp_address_families); |