aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2007-02-09 09:25:18 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-11 02:20:11 -0500
commitd808ad9ab8b1109239027c248c4652503b9d3029 (patch)
treecdd09b4987a4efd687a0a138491d626f8b674de5 /net/sctp/socket.c
parent10297b99315e5e08fe623ba56da35db1fee69ba9 (diff)
[NET] SCTP: Fix whitespace errors.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c114
1 files changed, 57 insertions, 57 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 388d0fb1a377..536298c2eda2 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -381,12 +381,12 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
381 381
382 /* ADDIP Section 4.1.1 Congestion Control of ASCONF Chunks 382 /* ADDIP Section 4.1.1 Congestion Control of ASCONF Chunks
383 * 383 *
384 * R1) One and only one ASCONF Chunk MAY be in transit and unacknowledged 384 * R1) One and only one ASCONF Chunk MAY be in transit and unacknowledged
385 * at any one time. If a sender, after sending an ASCONF chunk, decides 385 * at any one time. If a sender, after sending an ASCONF chunk, decides
386 * it needs to transfer another ASCONF Chunk, it MUST wait until the 386 * it needs to transfer another ASCONF Chunk, it MUST wait until the
387 * ASCONF-ACK Chunk returns from the previous ASCONF Chunk before sending a 387 * ASCONF-ACK Chunk returns from the previous ASCONF Chunk before sending a
388 * subsequent ASCONF. Note this restriction binds each side, so at any 388 * subsequent ASCONF. Note this restriction binds each side, so at any
389 * time two ASCONF may be in-transit on any given association (one sent 389 * time two ASCONF may be in-transit on any given association (one sent
390 * from each endpoint). 390 * from each endpoint).
391 */ 391 */
392static int sctp_send_asconf(struct sctp_association *asoc, 392static int sctp_send_asconf(struct sctp_association *asoc,
@@ -396,10 +396,10 @@ static int sctp_send_asconf(struct sctp_association *asoc,
396 396
397 /* If there is an outstanding ASCONF chunk, queue it for later 397 /* If there is an outstanding ASCONF chunk, queue it for later
398 * transmission. 398 * transmission.
399 */ 399 */
400 if (asoc->addip_last_asconf) { 400 if (asoc->addip_last_asconf) {
401 list_add_tail(&chunk->list, &asoc->addip_chunk_list); 401 list_add_tail(&chunk->list, &asoc->addip_chunk_list);
402 goto out; 402 goto out;
403 } 403 }
404 404
405 /* Hold the chunk until an ASCONF_ACK is received. */ 405 /* Hold the chunk until an ASCONF_ACK is received. */
@@ -449,7 +449,7 @@ int sctp_bindx_add(struct sock *sk, struct sockaddr *addrs, int addrcnt)
449 goto err_bindx_add; 449 goto err_bindx_add;
450 } 450 }
451 451
452 retval = sctp_do_bind(sk, (union sctp_addr *)sa_addr, 452 retval = sctp_do_bind(sk, (union sctp_addr *)sa_addr,
453 af->sockaddr_len); 453 af->sockaddr_len);
454 454
455 addr_buf += af->sockaddr_len; 455 addr_buf += af->sockaddr_len;
@@ -470,13 +470,13 @@ err_bindx_add:
470 * associations that are part of the endpoint indicating that a list of local 470 * associations that are part of the endpoint indicating that a list of local
471 * addresses are added to the endpoint. 471 * addresses are added to the endpoint.
472 * 472 *
473 * If any of the addresses is already in the bind address list of the 473 * If any of the addresses is already in the bind address list of the
474 * association, we do not send the chunk for that association. But it will not 474 * association, we do not send the chunk for that association. But it will not
475 * affect other associations. 475 * affect other associations.
476 * 476 *
477 * Only sctp_setsockopt_bindx() is supposed to call this function. 477 * Only sctp_setsockopt_bindx() is supposed to call this function.
478 */ 478 */
479static int sctp_send_asconf_add_ip(struct sock *sk, 479static int sctp_send_asconf_add_ip(struct sock *sk,
480 struct sockaddr *addrs, 480 struct sockaddr *addrs,
481 int addrcnt) 481 int addrcnt)
482{ 482{
@@ -517,8 +517,8 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
517 continue; 517 continue;
518 518
519 /* Check if any address in the packed array of addresses is 519 /* Check if any address in the packed array of addresses is
520 * in the bind address list of the association. If so, 520 * in the bind address list of the association. If so,
521 * do not send the asconf chunk to its peer, but continue with 521 * do not send the asconf chunk to its peer, but continue with
522 * other associations. 522 * other associations.
523 */ 523 */
524 addr_buf = addrs; 524 addr_buf = addrs;
@@ -664,7 +664,7 @@ err_bindx_rem:
664 * the associations that are part of the endpoint indicating that a list of 664 * the associations that are part of the endpoint indicating that a list of
665 * local addresses are removed from the endpoint. 665 * local addresses are removed from the endpoint.
666 * 666 *
667 * If any of the addresses is already in the bind address list of the 667 * If any of the addresses is already in the bind address list of the
668 * association, we do not send the chunk for that association. But it will not 668 * association, we do not send the chunk for that association. But it will not
669 * affect other associations. 669 * affect other associations.
670 * 670 *
@@ -710,7 +710,7 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
710 continue; 710 continue;
711 711
712 /* Check if any address in the packed array of addresses is 712 /* Check if any address in the packed array of addresses is
713 * not present in the bind address list of the association. 713 * not present in the bind address list of the association.
714 * If so, do not send the asconf chunk to its peer, but 714 * If so, do not send the asconf chunk to its peer, but
715 * continue with other associations. 715 * continue with other associations.
716 */ 716 */
@@ -898,7 +898,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
898 return -EFAULT; 898 return -EFAULT;
899 } 899 }
900 900
901 /* Walk through the addrs buffer and count the number of addresses. */ 901 /* Walk through the addrs buffer and count the number of addresses. */
902 addr_buf = kaddrs; 902 addr_buf = kaddrs;
903 while (walk_size < addrs_size) { 903 while (walk_size < addrs_size) {
904 sa_addr = (struct sockaddr *)addr_buf; 904 sa_addr = (struct sockaddr *)addr_buf;
@@ -906,7 +906,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
906 906
907 /* If the address family is not supported or if this address 907 /* If the address family is not supported or if this address
908 * causes the address buffer to overflow return EINVAL. 908 * causes the address buffer to overflow return EINVAL.
909 */ 909 */
910 if (!af || (walk_size + af->sockaddr_len) > addrs_size) { 910 if (!af || (walk_size + af->sockaddr_len) > addrs_size) {
911 kfree(kaddrs); 911 kfree(kaddrs);
912 return -EINVAL; 912 return -EINVAL;
@@ -935,7 +935,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
935 default: 935 default:
936 err = -EINVAL; 936 err = -EINVAL;
937 break; 937 break;
938 }; 938 };
939 939
940out: 940out:
941 kfree(kaddrs); 941 kfree(kaddrs);
@@ -1035,10 +1035,10 @@ static int __sctp_connect(struct sock* sk,
1035 } 1035 }
1036 } else { 1036 } else {
1037 /* 1037 /*
1038 * If an unprivileged user inherits a 1-many 1038 * If an unprivileged user inherits a 1-many
1039 * style socket with open associations on a 1039 * style socket with open associations on a
1040 * privileged port, it MAY be permitted to 1040 * privileged port, it MAY be permitted to
1041 * accept new associations, but it SHOULD NOT 1041 * accept new associations, but it SHOULD NOT
1042 * be permitted to open new associations. 1042 * be permitted to open new associations.
1043 */ 1043 */
1044 if (ep->base.bind_addr.port < PROT_SOCK && 1044 if (ep->base.bind_addr.port < PROT_SOCK &&
@@ -1094,8 +1094,8 @@ static int __sctp_connect(struct sock* sk,
1094out_free: 1094out_free:
1095 1095
1096 SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p" 1096 SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p"
1097 " kaddrs: %p err: %d\n", 1097 " kaddrs: %p err: %d\n",
1098 asoc, kaddrs, err); 1098 asoc, kaddrs, err);
1099 if (asoc) 1099 if (asoc)
1100 sctp_association_free(asoc); 1100 sctp_association_free(asoc);
1101 return err; 1101 return err;
@@ -1435,7 +1435,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1435 * length messages when SCTP_EOF|SCTP_ABORT is not set. 1435 * length messages when SCTP_EOF|SCTP_ABORT is not set.
1436 * If SCTP_ABORT is set, the message length could be non zero with 1436 * If SCTP_ABORT is set, the message length could be non zero with
1437 * the msg_iov set to the user abort reason. 1437 * the msg_iov set to the user abort reason.
1438 */ 1438 */
1439 if (((sinfo_flags & SCTP_EOF) && (msg_len > 0)) || 1439 if (((sinfo_flags & SCTP_EOF) && (msg_len > 0)) ||
1440 (!(sinfo_flags & (SCTP_EOF|SCTP_ABORT)) && (msg_len == 0))) { 1440 (!(sinfo_flags & (SCTP_EOF|SCTP_ABORT)) && (msg_len == 0))) {
1441 err = -EINVAL; 1441 err = -EINVAL;
@@ -1599,7 +1599,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1599 = sinit->sinit_max_attempts; 1599 = sinit->sinit_max_attempts;
1600 } 1600 }
1601 if (sinit->sinit_max_init_timeo) { 1601 if (sinit->sinit_max_init_timeo) {
1602 asoc->max_init_timeo = 1602 asoc->max_init_timeo =
1603 msecs_to_jiffies(sinit->sinit_max_init_timeo); 1603 msecs_to_jiffies(sinit->sinit_max_init_timeo);
1604 } 1604 }
1605 } 1605 }
@@ -2298,7 +2298,7 @@ static int sctp_setsockopt_delayed_ack_time(struct sock *sk,
2298 /* Get association, if assoc_id != 0 and the socket is a one 2298 /* Get association, if assoc_id != 0 and the socket is a one
2299 * to many style socket, and an association was not found, then 2299 * to many style socket, and an association was not found, then
2300 * the id was invalid. 2300 * the id was invalid.
2301 */ 2301 */
2302 asoc = sctp_id2assoc(sk, params.assoc_id); 2302 asoc = sctp_id2assoc(sk, params.assoc_id);
2303 if (!asoc && params.assoc_id && sctp_style(sk, UDP)) 2303 if (!asoc && params.assoc_id && sctp_style(sk, UDP))
2304 return -EINVAL; 2304 return -EINVAL;
@@ -2307,22 +2307,22 @@ static int sctp_setsockopt_delayed_ack_time(struct sock *sk,
2307 if (asoc) { 2307 if (asoc) {
2308 asoc->sackdelay = 2308 asoc->sackdelay =
2309 msecs_to_jiffies(params.assoc_value); 2309 msecs_to_jiffies(params.assoc_value);
2310 asoc->param_flags = 2310 asoc->param_flags =
2311 (asoc->param_flags & ~SPP_SACKDELAY) | 2311 (asoc->param_flags & ~SPP_SACKDELAY) |
2312 SPP_SACKDELAY_ENABLE; 2312 SPP_SACKDELAY_ENABLE;
2313 } else { 2313 } else {
2314 sp->sackdelay = params.assoc_value; 2314 sp->sackdelay = params.assoc_value;
2315 sp->param_flags = 2315 sp->param_flags =
2316 (sp->param_flags & ~SPP_SACKDELAY) | 2316 (sp->param_flags & ~SPP_SACKDELAY) |
2317 SPP_SACKDELAY_ENABLE; 2317 SPP_SACKDELAY_ENABLE;
2318 } 2318 }
2319 } else { 2319 } else {
2320 if (asoc) { 2320 if (asoc) {
2321 asoc->param_flags = 2321 asoc->param_flags =
2322 (asoc->param_flags & ~SPP_SACKDELAY) | 2322 (asoc->param_flags & ~SPP_SACKDELAY) |
2323 SPP_SACKDELAY_DISABLE; 2323 SPP_SACKDELAY_DISABLE;
2324 } else { 2324 } else {
2325 sp->param_flags = 2325 sp->param_flags =
2326 (sp->param_flags & ~SPP_SACKDELAY) | 2326 (sp->param_flags & ~SPP_SACKDELAY) |
2327 SPP_SACKDELAY_DISABLE; 2327 SPP_SACKDELAY_DISABLE;
2328 } 2328 }
@@ -2338,17 +2338,17 @@ static int sctp_setsockopt_delayed_ack_time(struct sock *sk,
2338 if (params.assoc_value) { 2338 if (params.assoc_value) {
2339 trans->sackdelay = 2339 trans->sackdelay =
2340 msecs_to_jiffies(params.assoc_value); 2340 msecs_to_jiffies(params.assoc_value);
2341 trans->param_flags = 2341 trans->param_flags =
2342 (trans->param_flags & ~SPP_SACKDELAY) | 2342 (trans->param_flags & ~SPP_SACKDELAY) |
2343 SPP_SACKDELAY_ENABLE; 2343 SPP_SACKDELAY_ENABLE;
2344 } else { 2344 } else {
2345 trans->param_flags = 2345 trans->param_flags =
2346 (trans->param_flags & ~SPP_SACKDELAY) | 2346 (trans->param_flags & ~SPP_SACKDELAY) |
2347 SPP_SACKDELAY_DISABLE; 2347 SPP_SACKDELAY_DISABLE;
2348 } 2348 }
2349 } 2349 }
2350 } 2350 }
2351 2351
2352 return 0; 2352 return 0;
2353} 2353}
2354 2354
@@ -2374,13 +2374,13 @@ static int sctp_setsockopt_initmsg(struct sock *sk, char __user *optval, int opt
2374 return -EFAULT; 2374 return -EFAULT;
2375 2375
2376 if (sinit.sinit_num_ostreams) 2376 if (sinit.sinit_num_ostreams)
2377 sp->initmsg.sinit_num_ostreams = sinit.sinit_num_ostreams; 2377 sp->initmsg.sinit_num_ostreams = sinit.sinit_num_ostreams;
2378 if (sinit.sinit_max_instreams) 2378 if (sinit.sinit_max_instreams)
2379 sp->initmsg.sinit_max_instreams = sinit.sinit_max_instreams; 2379 sp->initmsg.sinit_max_instreams = sinit.sinit_max_instreams;
2380 if (sinit.sinit_max_attempts) 2380 if (sinit.sinit_max_attempts)
2381 sp->initmsg.sinit_max_attempts = sinit.sinit_max_attempts; 2381 sp->initmsg.sinit_max_attempts = sinit.sinit_max_attempts;
2382 if (sinit.sinit_max_init_timeo) 2382 if (sinit.sinit_max_init_timeo)
2383 sp->initmsg.sinit_max_init_timeo = sinit.sinit_max_init_timeo; 2383 sp->initmsg.sinit_max_init_timeo = sinit.sinit_max_init_timeo;
2384 2384
2385 return 0; 2385 return 0;
2386} 2386}
@@ -2511,7 +2511,7 @@ static int sctp_setsockopt_rtoinfo(struct sock *sk, char __user *optval, int opt
2511 2511
2512 if (asoc) { 2512 if (asoc) {
2513 if (rtoinfo.srto_initial != 0) 2513 if (rtoinfo.srto_initial != 0)
2514 asoc->rto_initial = 2514 asoc->rto_initial =
2515 msecs_to_jiffies(rtoinfo.srto_initial); 2515 msecs_to_jiffies(rtoinfo.srto_initial);
2516 if (rtoinfo.srto_max != 0) 2516 if (rtoinfo.srto_max != 0)
2517 asoc->rto_max = msecs_to_jiffies(rtoinfo.srto_max); 2517 asoc->rto_max = msecs_to_jiffies(rtoinfo.srto_max);
@@ -2665,7 +2665,7 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl
2665 /* Update the frag_point of the existing associations. */ 2665 /* Update the frag_point of the existing associations. */
2666 list_for_each(pos, &(sp->ep->asocs)) { 2666 list_for_each(pos, &(sp->ep->asocs)) {
2667 asoc = list_entry(pos, struct sctp_association, asocs); 2667 asoc = list_entry(pos, struct sctp_association, asocs);
2668 asoc->frag_point = sctp_frag_point(sp, asoc->pathmtu); 2668 asoc->frag_point = sctp_frag_point(sp, asoc->pathmtu);
2669 } 2669 }
2670 2670
2671 return 0; 2671 return 0;
@@ -2703,7 +2703,7 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva
2703 return -EFAULT; 2703 return -EFAULT;
2704 2704
2705 asoc = sctp_id2assoc(sk, prim.sspp_assoc_id); 2705 asoc = sctp_id2assoc(sk, prim.sspp_assoc_id);
2706 if (!asoc) 2706 if (!asoc)
2707 return -EINVAL; 2707 return -EINVAL;
2708 2708
2709 if (!asoc->peer.asconf_capable) 2709 if (!asoc->peer.asconf_capable)
@@ -3015,7 +3015,7 @@ SCTP_STATIC struct sock *sctp_accept(struct sock *sk, int flags, int *err)
3015 3015
3016out: 3016out:
3017 sctp_release_sock(sk); 3017 sctp_release_sock(sk);
3018 *err = error; 3018 *err = error;
3019 return newsk; 3019 return newsk;
3020} 3020}
3021 3021
@@ -3087,7 +3087,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
3087 sp->assocparams.sasoc_cookie_life = sctp_valid_cookie_life; 3087 sp->assocparams.sasoc_cookie_life = sctp_valid_cookie_life;
3088 3088
3089 /* Initialize default event subscriptions. By default, all the 3089 /* Initialize default event subscriptions. By default, all the
3090 * options are off. 3090 * options are off.
3091 */ 3091 */
3092 memset(&sp->subscribe, 0, sizeof(struct sctp_event_subscribe)); 3092 memset(&sp->subscribe, 0, sizeof(struct sctp_event_subscribe));
3093 3093
@@ -3099,8 +3099,8 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
3099 sp->pathmtu = 0; // allow default discovery 3099 sp->pathmtu = 0; // allow default discovery
3100 sp->sackdelay = sctp_sack_timeout; 3100 sp->sackdelay = sctp_sack_timeout;
3101 sp->param_flags = SPP_HB_ENABLE | 3101 sp->param_flags = SPP_HB_ENABLE |
3102 SPP_PMTUD_ENABLE | 3102 SPP_PMTUD_ENABLE |
3103 SPP_SACKDELAY_ENABLE; 3103 SPP_SACKDELAY_ENABLE;
3104 3104
3105 /* If enabled no SCTP message fragmentation will be performed. 3105 /* If enabled no SCTP message fragmentation will be performed.
3106 * Configure through SCTP_DISABLE_FRAGMENTS socket option. 3106 * Configure through SCTP_DISABLE_FRAGMENTS socket option.
@@ -3680,7 +3680,7 @@ static int sctp_getsockopt_delayed_ack_time(struct sock *sk, int len,
3680 /* Get association, if assoc_id != 0 and the socket is a one 3680 /* Get association, if assoc_id != 0 and the socket is a one
3681 * to many style socket, and an association was not found, then 3681 * to many style socket, and an association was not found, then
3682 * the id was invalid. 3682 * the id was invalid.
3683 */ 3683 */
3684 asoc = sctp_id2assoc(sk, params.assoc_id); 3684 asoc = sctp_id2assoc(sk, params.assoc_id);
3685 if (!asoc && params.assoc_id && sctp_style(sk, UDP)) 3685 if (!asoc && params.assoc_id && sctp_style(sk, UDP))
3686 return -EINVAL; 3686 return -EINVAL;
@@ -3756,7 +3756,7 @@ static int sctp_getsockopt_peer_addrs_num_old(struct sock *sk, int len,
3756 return cnt; 3756 return cnt;
3757} 3757}
3758 3758
3759/* 3759/*
3760 * Old API for getting list of peer addresses. Does not work for 32-bit 3760 * Old API for getting list of peer addresses. Does not work for 32-bit
3761 * programs running on a 64-bit kernel 3761 * programs running on a 64-bit kernel
3762 */ 3762 */
@@ -3833,7 +3833,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
3833 return -EINVAL; 3833 return -EINVAL;
3834 3834
3835 to = optval + offsetof(struct sctp_getaddrs,addrs); 3835 to = optval + offsetof(struct sctp_getaddrs,addrs);
3836 space_left = len - sizeof(struct sctp_getaddrs) - 3836 space_left = len - sizeof(struct sctp_getaddrs) -
3837 offsetof(struct sctp_getaddrs,addrs); 3837 offsetof(struct sctp_getaddrs,addrs);
3838 3838
3839 list_for_each(pos, &asoc->peer.transport_addr_list) { 3839 list_for_each(pos, &asoc->peer.transport_addr_list) {
@@ -3907,7 +3907,7 @@ static int sctp_getsockopt_local_addrs_num_old(struct sock *sk, int len,
3907 addr = list_entry(pos, 3907 addr = list_entry(pos,
3908 struct sctp_sockaddr_entry, 3908 struct sctp_sockaddr_entry,
3909 list); 3909 list);
3910 if ((PF_INET == sk->sk_family) && 3910 if ((PF_INET == sk->sk_family) &&
3911 (AF_INET6 == addr->a.sa.sa_family)) 3911 (AF_INET6 == addr->a.sa.sa_family))
3912 continue; 3912 continue;
3913 cnt++; 3913 cnt++;
@@ -3941,7 +3941,7 @@ static int sctp_copy_laddrs_to_user_old(struct sock *sk, __u16 port, int max_add
3941 3941
3942 list_for_each_safe(pos, next, &sctp_local_addr_list) { 3942 list_for_each_safe(pos, next, &sctp_local_addr_list) {
3943 addr = list_entry(pos, struct sctp_sockaddr_entry, list); 3943 addr = list_entry(pos, struct sctp_sockaddr_entry, list);
3944 if ((PF_INET == sk->sk_family) && 3944 if ((PF_INET == sk->sk_family) &&
3945 (AF_INET6 == addr->a.sa.sa_family)) 3945 (AF_INET6 == addr->a.sa.sa_family))
3946 continue; 3946 continue;
3947 memcpy(&temp, &addr->a, sizeof(temp)); 3947 memcpy(&temp, &addr->a, sizeof(temp));
@@ -3970,7 +3970,7 @@ static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port,
3970 3970
3971 list_for_each_safe(pos, next, &sctp_local_addr_list) { 3971 list_for_each_safe(pos, next, &sctp_local_addr_list) {
3972 addr = list_entry(pos, struct sctp_sockaddr_entry, list); 3972 addr = list_entry(pos, struct sctp_sockaddr_entry, list);
3973 if ((PF_INET == sk->sk_family) && 3973 if ((PF_INET == sk->sk_family) &&
3974 (AF_INET6 == addr->a.sa.sa_family)) 3974 (AF_INET6 == addr->a.sa.sa_family))
3975 continue; 3975 continue;
3976 memcpy(&temp, &addr->a, sizeof(temp)); 3976 memcpy(&temp, &addr->a, sizeof(temp));
@@ -4051,7 +4051,7 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len,
4051 err = cnt; 4051 err = cnt;
4052 goto unlock; 4052 goto unlock;
4053 } 4053 }
4054 goto copy_getaddrs; 4054 goto copy_getaddrs;
4055 } 4055 }
4056 } 4056 }
4057 4057
@@ -4139,7 +4139,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
4139 err = cnt; 4139 err = cnt;
4140 goto unlock; 4140 goto unlock;
4141 } 4141 }
4142 goto copy_getaddrs; 4142 goto copy_getaddrs;
4143 } 4143 }
4144 } 4144 }
4145 4145
@@ -4196,7 +4196,7 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len,
4196 4196
4197 if (!asoc->peer.primary_path) 4197 if (!asoc->peer.primary_path)
4198 return -ENOTCONN; 4198 return -ENOTCONN;
4199 4199
4200 memcpy(&prim.ssp_addr, &asoc->peer.primary_path->ipaddr, 4200 memcpy(&prim.ssp_addr, &asoc->peer.primary_path->ipaddr,
4201 asoc->peer.primary_path->af_specific->sockaddr_len); 4201 asoc->peer.primary_path->af_specific->sockaddr_len);
4202 4202
@@ -4864,7 +4864,7 @@ SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog)
4864 if (!backlog) { 4864 if (!backlog) {
4865 if (sctp_sstate(sk, CLOSED)) 4865 if (sctp_sstate(sk, CLOSED))
4866 return 0; 4866 return 0;
4867 4867
4868 sctp_unhash_endpoint(ep); 4868 sctp_unhash_endpoint(ep);
4869 sk->sk_state = SCTP_SS_CLOSED; 4869 sk->sk_state = SCTP_SS_CLOSED;
4870 } 4870 }
@@ -4872,7 +4872,7 @@ SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog)
4872 /* Return if we are already listening. */ 4872 /* Return if we are already listening. */
4873 if (sctp_sstate(sk, LISTENING)) 4873 if (sctp_sstate(sk, LISTENING))
4874 return 0; 4874 return 0;
4875 4875
4876 /* 4876 /*
4877 * If a bind() or sctp_bindx() is not called prior to a listen() 4877 * If a bind() or sctp_bindx() is not called prior to a listen()
4878 * call that allows new associations to be accepted, the system 4878 * call that allows new associations to be accepted, the system
@@ -4907,7 +4907,7 @@ SCTP_STATIC int sctp_stream_listen(struct sock *sk, int backlog)
4907 if (!backlog) { 4907 if (!backlog) {
4908 if (sctp_sstate(sk, CLOSED)) 4908 if (sctp_sstate(sk, CLOSED))
4909 return 0; 4909 return 0;
4910 4910
4911 sctp_unhash_endpoint(ep); 4911 sctp_unhash_endpoint(ep);
4912 sk->sk_state = SCTP_SS_CLOSED; 4912 sk->sk_state = SCTP_SS_CLOSED;
4913 } 4913 }
@@ -5010,7 +5010,7 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
5010 */ 5010 */
5011 if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING)) 5011 if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING))
5012 return (!list_empty(&sp->ep->asocs)) ? 5012 return (!list_empty(&sp->ep->asocs)) ?
5013 (POLLIN | POLLRDNORM) : 0; 5013 (POLLIN | POLLRDNORM) : 0;
5014 5014
5015 mask = 0; 5015 mask = 0;
5016 5016
@@ -5430,7 +5430,7 @@ static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p,
5430 DEFINE_WAIT(wait); 5430 DEFINE_WAIT(wait);
5431 5431
5432 SCTP_DEBUG_PRINTK("wait_for_sndbuf: asoc=%p, timeo=%ld, msg_len=%zu\n", 5432 SCTP_DEBUG_PRINTK("wait_for_sndbuf: asoc=%p, timeo=%ld, msg_len=%zu\n",
5433 asoc, (long)(*timeo_p), msg_len); 5433 asoc, (long)(*timeo_p), msg_len);
5434 5434
5435 /* Increment the association's refcnt. */ 5435 /* Increment the association's refcnt. */
5436 sctp_association_hold(asoc); 5436 sctp_association_hold(asoc);