diff options
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d39fd0c2c4cf..500972a9647e 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -1568,7 +1568,7 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1568 | struct net *net = sock_net(sk); | 1568 | struct net *net = sock_net(sk); |
1569 | struct sctp_sock *sp; | 1569 | struct sctp_sock *sp; |
1570 | struct sctp_endpoint *ep; | 1570 | struct sctp_endpoint *ep; |
1571 | struct sctp_association *new_asoc=NULL, *asoc=NULL; | 1571 | struct sctp_association *new_asoc = NULL, *asoc = NULL; |
1572 | struct sctp_transport *transport, *chunk_tp; | 1572 | struct sctp_transport *transport, *chunk_tp; |
1573 | struct sctp_chunk *chunk; | 1573 | struct sctp_chunk *chunk; |
1574 | union sctp_addr to; | 1574 | union sctp_addr to; |
@@ -2462,7 +2462,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk, | |||
2462 | int hb_change, pmtud_change, sackdelay_change; | 2462 | int hb_change, pmtud_change, sackdelay_change; |
2463 | 2463 | ||
2464 | if (optlen != sizeof(struct sctp_paddrparams)) | 2464 | if (optlen != sizeof(struct sctp_paddrparams)) |
2465 | return - EINVAL; | 2465 | return -EINVAL; |
2466 | 2466 | ||
2467 | if (copy_from_user(¶ms, optval, optlen)) | 2467 | if (copy_from_user(¶ms, optval, optlen)) |
2468 | return -EFAULT; | 2468 | return -EFAULT; |
@@ -2483,7 +2483,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk, | |||
2483 | /* If an address other than INADDR_ANY is specified, and | 2483 | /* If an address other than INADDR_ANY is specified, and |
2484 | * no transport is found, then the request is invalid. | 2484 | * no transport is found, then the request is invalid. |
2485 | */ | 2485 | */ |
2486 | if (!sctp_is_any(sk, ( union sctp_addr *)¶ms.spp_address)) { | 2486 | if (!sctp_is_any(sk, (union sctp_addr *)¶ms.spp_address)) { |
2487 | trans = sctp_addr_id2transport(sk, ¶ms.spp_address, | 2487 | trans = sctp_addr_id2transport(sk, ¶ms.spp_address, |
2488 | params.spp_assoc_id); | 2488 | params.spp_assoc_id); |
2489 | if (!trans) | 2489 | if (!trans) |
@@ -2588,7 +2588,7 @@ static int sctp_setsockopt_delayed_ack(struct sock *sk, | |||
2588 | else | 2588 | else |
2589 | params.sack_freq = 0; | 2589 | params.sack_freq = 0; |
2590 | } else | 2590 | } else |
2591 | return - EINVAL; | 2591 | return -EINVAL; |
2592 | 2592 | ||
2593 | /* Validate value parameter. */ | 2593 | /* Validate value parameter. */ |
2594 | if (params.sack_delay > 500) | 2594 | if (params.sack_delay > 500) |
@@ -3332,7 +3332,7 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk, | |||
3332 | if (optlen < sizeof(struct sctp_hmacalgo)) | 3332 | if (optlen < sizeof(struct sctp_hmacalgo)) |
3333 | return -EINVAL; | 3333 | return -EINVAL; |
3334 | 3334 | ||
3335 | hmacs= memdup_user(optval, optlen); | 3335 | hmacs = memdup_user(optval, optlen); |
3336 | if (IS_ERR(hmacs)) | 3336 | if (IS_ERR(hmacs)) |
3337 | return PTR_ERR(hmacs); | 3337 | return PTR_ERR(hmacs); |
3338 | 3338 | ||
@@ -3370,7 +3370,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk, | |||
3370 | if (optlen <= sizeof(struct sctp_authkey)) | 3370 | if (optlen <= sizeof(struct sctp_authkey)) |
3371 | return -EINVAL; | 3371 | return -EINVAL; |
3372 | 3372 | ||
3373 | authkey= memdup_user(optval, optlen); | 3373 | authkey = memdup_user(optval, optlen); |
3374 | if (IS_ERR(authkey)) | 3374 | if (IS_ERR(authkey)) |
3375 | return PTR_ERR(authkey); | 3375 | return PTR_ERR(authkey); |
3376 | 3376 | ||
@@ -4467,7 +4467,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len, | |||
4467 | /* If an address other than INADDR_ANY is specified, and | 4467 | /* If an address other than INADDR_ANY is specified, and |
4468 | * no transport is found, then the request is invalid. | 4468 | * no transport is found, then the request is invalid. |
4469 | */ | 4469 | */ |
4470 | if (!sctp_is_any(sk, ( union sctp_addr *)¶ms.spp_address)) { | 4470 | if (!sctp_is_any(sk, (union sctp_addr *)¶ms.spp_address)) { |
4471 | trans = sctp_addr_id2transport(sk, ¶ms.spp_address, | 4471 | trans = sctp_addr_id2transport(sk, ¶ms.spp_address, |
4472 | params.spp_assoc_id); | 4472 | params.spp_assoc_id); |
4473 | if (!trans) { | 4473 | if (!trans) { |
@@ -4578,7 +4578,7 @@ static int sctp_getsockopt_delayed_ack(struct sock *sk, int len, | |||
4578 | if (copy_from_user(¶ms, optval, len)) | 4578 | if (copy_from_user(¶ms, optval, len)) |
4579 | return -EFAULT; | 4579 | return -EFAULT; |
4580 | } else | 4580 | } else |
4581 | return - EINVAL; | 4581 | return -EINVAL; |
4582 | 4582 | ||
4583 | /* Get association, if sack_assoc_id != 0 and the socket is a one | 4583 | /* Get association, if sack_assoc_id != 0 and the socket is a one |
4584 | * to many style socket, and an association was not found, then | 4584 | * to many style socket, and an association was not found, then |
@@ -4668,8 +4668,8 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, | |||
4668 | if (!asoc) | 4668 | if (!asoc) |
4669 | return -EINVAL; | 4669 | return -EINVAL; |
4670 | 4670 | ||
4671 | to = optval + offsetof(struct sctp_getaddrs,addrs); | 4671 | to = optval + offsetof(struct sctp_getaddrs, addrs); |
4672 | space_left = len - offsetof(struct sctp_getaddrs,addrs); | 4672 | space_left = len - offsetof(struct sctp_getaddrs, addrs); |
4673 | 4673 | ||
4674 | list_for_each_entry(from, &asoc->peer.transport_addr_list, | 4674 | list_for_each_entry(from, &asoc->peer.transport_addr_list, |
4675 | transports) { | 4675 | transports) { |
@@ -4729,7 +4729,7 @@ static int sctp_copy_laddrs(struct sock *sk, __u16 port, void *to, | |||
4729 | memcpy(to, &temp, addrlen); | 4729 | memcpy(to, &temp, addrlen); |
4730 | 4730 | ||
4731 | to += addrlen; | 4731 | to += addrlen; |
4732 | cnt ++; | 4732 | cnt++; |
4733 | space_left -= addrlen; | 4733 | space_left -= addrlen; |
4734 | *bytes_copied += addrlen; | 4734 | *bytes_copied += addrlen; |
4735 | } | 4735 | } |
@@ -4778,8 +4778,8 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, | |||
4778 | bp = &asoc->base.bind_addr; | 4778 | bp = &asoc->base.bind_addr; |
4779 | } | 4779 | } |
4780 | 4780 | ||
4781 | to = optval + offsetof(struct sctp_getaddrs,addrs); | 4781 | to = optval + offsetof(struct sctp_getaddrs, addrs); |
4782 | space_left = len - offsetof(struct sctp_getaddrs,addrs); | 4782 | space_left = len - offsetof(struct sctp_getaddrs, addrs); |
4783 | 4783 | ||
4784 | addrs = kmalloc(space_left, GFP_KERNEL); | 4784 | addrs = kmalloc(space_left, GFP_KERNEL); |
4785 | if (!addrs) | 4785 | if (!addrs) |
@@ -4818,7 +4818,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, | |||
4818 | memcpy(buf, &temp, addrlen); | 4818 | memcpy(buf, &temp, addrlen); |
4819 | buf += addrlen; | 4819 | buf += addrlen; |
4820 | bytes_copied += addrlen; | 4820 | bytes_copied += addrlen; |
4821 | cnt ++; | 4821 | cnt++; |
4822 | space_left -= addrlen; | 4822 | space_left -= addrlen; |
4823 | } | 4823 | } |
4824 | 4824 | ||
@@ -5090,7 +5090,7 @@ static int sctp_getsockopt_associnfo(struct sock *sk, int len, | |||
5090 | assocparams.sasoc_cookie_life = ktime_to_ms(asoc->cookie_life); | 5090 | assocparams.sasoc_cookie_life = ktime_to_ms(asoc->cookie_life); |
5091 | 5091 | ||
5092 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 5092 | list_for_each(pos, &asoc->peer.transport_addr_list) { |
5093 | cnt ++; | 5093 | cnt++; |
5094 | } | 5094 | } |
5095 | 5095 | ||
5096 | assocparams.sasoc_number_peer_destinations = cnt; | 5096 | assocparams.sasoc_number_peer_destinations = cnt; |