Commit cb3f837b authored by wangweidong's avatar wangweidong Committed by David S. Miller

sctp: fix checkpatch errors with space required or prohibited

fix checkpatch errors while the space is required or prohibited
to the "=,()++..."
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarWang Weidong <wangweidong1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4c99aa40
...@@ -41,7 +41,7 @@ static struct sctp_hmac sctp_hmac_list[SCTP_AUTH_NUM_HMACS] = { ...@@ -41,7 +41,7 @@ static struct sctp_hmac sctp_hmac_list[SCTP_AUTH_NUM_HMACS] = {
}, },
{ {
.hmac_id = SCTP_AUTH_HMAC_ID_SHA1, .hmac_id = SCTP_AUTH_HMAC_ID_SHA1,
.hmac_name="hmac(sha1)", .hmac_name = "hmac(sha1)",
.hmac_len = SCTP_SHA1_SIG_SIZE, .hmac_len = SCTP_SHA1_SIG_SIZE,
}, },
{ {
...@@ -51,7 +51,7 @@ static struct sctp_hmac sctp_hmac_list[SCTP_AUTH_NUM_HMACS] = { ...@@ -51,7 +51,7 @@ static struct sctp_hmac sctp_hmac_list[SCTP_AUTH_NUM_HMACS] = {
#if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE) #if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE)
{ {
.hmac_id = SCTP_AUTH_HMAC_ID_SHA256, .hmac_id = SCTP_AUTH_HMAC_ID_SHA256,
.hmac_name="hmac(sha256)", .hmac_name = "hmac(sha256)",
.hmac_len = SCTP_SHA256_SIG_SIZE, .hmac_len = SCTP_SHA256_SIG_SIZE,
} }
#endif #endif
...@@ -163,7 +163,7 @@ static int sctp_auth_compare_vectors(struct sctp_auth_bytes *vector1, ...@@ -163,7 +163,7 @@ static int sctp_auth_compare_vectors(struct sctp_auth_bytes *vector1,
* lead-zero padded. If it is not, it * lead-zero padded. If it is not, it
* is automatically larger numerically. * is automatically larger numerically.
*/ */
for (i = 0; i < abs(diff); i++ ) { for (i = 0; i < abs(diff); i++) {
if (longer[i] != 0) if (longer[i] != 0)
return diff; return diff;
} }
......
...@@ -254,7 +254,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, ...@@ -254,7 +254,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
SCTP_INC_STATS_USER(sock_net(asoc->base.sk), SCTP_MIB_FRAGUSRMSGS); SCTP_INC_STATS_USER(sock_net(asoc->base.sk), SCTP_MIB_FRAGUSRMSGS);
/* Create chunks for all the full sized DATA chunks. */ /* Create chunks for all the full sized DATA chunks. */
for (i=0, len=first_len; i < whole; i++) { for (i = 0, len = first_len; i < whole; i++) {
frag = SCTP_DATA_MIDDLE_FRAG; frag = SCTP_DATA_MIDDLE_FRAG;
if (0 == i) if (0 == i)
...@@ -317,7 +317,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, ...@@ -317,7 +317,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
goto errout; goto errout;
} }
err = sctp_user_addto_chunk(chunk, offset, over,msgh->msg_iov); err = sctp_user_addto_chunk(chunk, offset, over, msgh->msg_iov);
/* Put the chunk->skb back into the form expected by send. */ /* Put the chunk->skb back into the form expected by send. */
__skb_pull(chunk->skb, (__u8 *)chunk->chunk_hdr __skb_pull(chunk->skb, (__u8 *)chunk->chunk_hdr
......
...@@ -119,7 +119,7 @@ int sctp_rcv(struct sk_buff *skb) ...@@ -119,7 +119,7 @@ int sctp_rcv(struct sk_buff *skb)
struct sctp_af *af; struct sctp_af *af;
struct net *net = dev_net(skb->dev); struct net *net = dev_net(skb->dev);
if (skb->pkt_type!=PACKET_HOST) if (skb->pkt_type != PACKET_HOST)
goto discard_it; goto discard_it;
SCTP_INC_STATS_BH(net, SCTP_MIB_INSCTPPACKS); SCTP_INC_STATS_BH(net, SCTP_MIB_INSCTPPACKS);
...@@ -1055,7 +1055,7 @@ static struct sctp_association *__sctp_rcv_walk_lookup(struct net *net, ...@@ -1055,7 +1055,7 @@ static struct sctp_association *__sctp_rcv_walk_lookup(struct net *net,
if (ch_end > skb_tail_pointer(skb)) if (ch_end > skb_tail_pointer(skb))
break; break;
switch(ch->type) { switch (ch->type) {
case SCTP_CID_AUTH: case SCTP_CID_AUTH:
have_auth = chunk_num; have_auth = chunk_num;
break; break;
......
...@@ -402,7 +402,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist, ...@@ -402,7 +402,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist,
} }
/* Initialize a sockaddr_storage from in incoming skb. */ /* Initialize a sockaddr_storage from in incoming skb. */
static void sctp_v6_from_skb(union sctp_addr *addr,struct sk_buff *skb, static void sctp_v6_from_skb(union sctp_addr *addr, struct sk_buff *skb,
int is_saddr) int is_saddr)
{ {
__be16 *port; __be16 *port;
......
...@@ -110,7 +110,7 @@ static inline int sctp_cacc_skip_3_1_d(struct sctp_transport *primary, ...@@ -110,7 +110,7 @@ static inline int sctp_cacc_skip_3_1_d(struct sctp_transport *primary,
struct sctp_transport *transport, struct sctp_transport *transport,
int count_of_newacks) int count_of_newacks)
{ {
if (count_of_newacks >=2 && transport != primary) if (count_of_newacks >= 2 && transport != primary)
return 1; return 1;
return 0; return 0;
} }
...@@ -470,7 +470,7 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport, ...@@ -470,7 +470,7 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport,
struct net *net = sock_net(q->asoc->base.sk); struct net *net = sock_net(q->asoc->base.sk);
int error = 0; int error = 0;
switch(reason) { switch (reason) {
case SCTP_RTXR_T3_RTX: case SCTP_RTXR_T3_RTX:
SCTP_INC_STATS(net, SCTP_MIB_T3_RETRANSMITS); SCTP_INC_STATS(net, SCTP_MIB_T3_RETRANSMITS);
sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_T3_RTX); sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_T3_RTX);
...@@ -1088,7 +1088,7 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) ...@@ -1088,7 +1088,7 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
* *
* --xguo * --xguo
*/ */
while ((ltransport = sctp_list_dequeue(&transport_list)) != NULL ) { while ((ltransport = sctp_list_dequeue(&transport_list)) != NULL) {
struct sctp_transport *t = list_entry(ltransport, struct sctp_transport *t = list_entry(ltransport,
struct sctp_transport, struct sctp_transport,
send_ready); send_ready);
...@@ -1217,7 +1217,7 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk) ...@@ -1217,7 +1217,7 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk)
* destinations for which cacc_saw_newack is set. * destinations for which cacc_saw_newack is set.
*/ */
if (transport->cacc.cacc_saw_newack) if (transport->cacc.cacc_saw_newack)
count_of_newacks ++; count_of_newacks++;
} }
/* Move the Cumulative TSN Ack Point if appropriate. */ /* Move the Cumulative TSN Ack Point if appropriate. */
......
...@@ -2308,7 +2308,7 @@ int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk, ...@@ -2308,7 +2308,7 @@ int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk,
* added as the primary transport. The source address seems to * added as the primary transport. The source address seems to
* be a a better choice than any of the embedded addresses. * be a a better choice than any of the embedded addresses.
*/ */
if(!sctp_assoc_add_peer(asoc, peer_addr, gfp, SCTP_ACTIVE)) if (!sctp_assoc_add_peer(asoc, peer_addr, gfp, SCTP_ACTIVE))
goto nomem; goto nomem;
if (sctp_cmp_addr_exact(sctp_source(chunk), peer_addr)) if (sctp_cmp_addr_exact(sctp_source(chunk), peer_addr))
...@@ -3334,7 +3334,7 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack, ...@@ -3334,7 +3334,7 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack,
while (asconf_ack_len > 0) { while (asconf_ack_len > 0) {
if (asconf_ack_param->crr_id == asconf_param->crr_id) { if (asconf_ack_param->crr_id == asconf_param->crr_id) {
switch(asconf_ack_param->param_hdr.type) { switch (asconf_ack_param->param_hdr.type) {
case SCTP_PARAM_SUCCESS_REPORT: case SCTP_PARAM_SUCCESS_REPORT:
return SCTP_ERROR_NO_ERROR; return SCTP_ERROR_NO_ERROR;
case SCTP_PARAM_ERR_CAUSE: case SCTP_PARAM_ERR_CAUSE:
......
...@@ -543,7 +543,7 @@ static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands, ...@@ -543,7 +543,7 @@ static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands,
{ {
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
event = sctp_ulpevent_make_assoc_change(asoc,0, SCTP_CANT_STR_ASSOC, event = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_CANT_STR_ASSOC,
(__u16)error, 0, 0, NULL, (__u16)error, 0, 0, NULL,
GFP_ATOMIC); GFP_ATOMIC);
......
...@@ -2945,7 +2945,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(struct net *net, ...@@ -2945,7 +2945,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(struct net *net,
return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
commands); commands);
error = sctp_eat_data(asoc, chunk, commands ); error = sctp_eat_data(asoc, chunk, commands);
switch (error) { switch (error) {
case SCTP_IERROR_NO_ERROR: case SCTP_IERROR_NO_ERROR:
break; break;
...@@ -3066,7 +3066,7 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(struct net *net, ...@@ -3066,7 +3066,7 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(struct net *net,
return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
commands); commands);
error = sctp_eat_data(asoc, chunk, commands ); error = sctp_eat_data(asoc, chunk, commands);
switch (error) { switch (error) {
case SCTP_IERROR_NO_ERROR: case SCTP_IERROR_NO_ERROR:
case SCTP_IERROR_HIGH_TSN: case SCTP_IERROR_HIGH_TSN:
...@@ -3765,7 +3765,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net, ...@@ -3765,7 +3765,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net,
*/ */
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
SCTP_ERROR(ECONNABORTED)); SCTP_ERROR(ECONNABORTED));
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
...@@ -3799,7 +3799,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net, ...@@ -3799,7 +3799,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net,
/* We are going to ABORT, so we might as well stop /* We are going to ABORT, so we might as well stop
* processing the rest of the chunks in the packet. * processing the rest of the chunks in the packet.
*/ */
sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
SCTP_ERROR(ECONNABORTED)); SCTP_ERROR(ECONNABORTED));
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
...@@ -4451,7 +4451,7 @@ static sctp_disposition_t sctp_sf_violation_chunklen( ...@@ -4451,7 +4451,7 @@ static sctp_disposition_t sctp_sf_violation_chunklen(
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
static const char err_str[]="The following chunk had invalid length:"; static const char err_str[] = "The following chunk had invalid length:";
return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
sizeof(err_str)); sizeof(err_str));
...@@ -4514,7 +4514,7 @@ static sctp_disposition_t sctp_sf_violation_ctsn( ...@@ -4514,7 +4514,7 @@ static sctp_disposition_t sctp_sf_violation_ctsn(
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
static const char err_str[]="The cumulative tsn ack beyond the max tsn currently sent:"; static const char err_str[] = "The cumulative tsn ack beyond the max tsn currently sent:";
return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
sizeof(err_str)); sizeof(err_str));
...@@ -4534,7 +4534,7 @@ static sctp_disposition_t sctp_sf_violation_chunk( ...@@ -4534,7 +4534,7 @@ static sctp_disposition_t sctp_sf_violation_chunk(
void *arg, void *arg,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
static const char err_str[]="The following chunk violates protocol:"; static const char err_str[] = "The following chunk violates protocol:";
if (!asoc) if (!asoc)
return sctp_sf_violation(net, ep, asoc, type, arg, commands); return sctp_sf_violation(net, ep, asoc, type, arg, commands);
...@@ -6000,7 +6000,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net, ...@@ -6000,7 +6000,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net,
/* Special case the INIT-ACK as there is no peer's vtag /* Special case the INIT-ACK as there is no peer's vtag
* yet. * yet.
*/ */
switch(chunk->chunk_hdr->type) { switch (chunk->chunk_hdr->type) {
case SCTP_CID_INIT_ACK: case SCTP_CID_INIT_ACK:
{ {
sctp_initack_chunk_t *initack; sctp_initack_chunk_t *initack;
...@@ -6017,7 +6017,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net, ...@@ -6017,7 +6017,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net,
/* Special case the INIT and stale COOKIE_ECHO as there is no /* Special case the INIT and stale COOKIE_ECHO as there is no
* vtag yet. * vtag yet.
*/ */
switch(chunk->chunk_hdr->type) { switch (chunk->chunk_hdr->type) {
case SCTP_CID_INIT: case SCTP_CID_INIT:
{ {
sctp_init_chunk_t *init; sctp_init_chunk_t *init;
...@@ -6231,7 +6231,7 @@ static int sctp_eat_data(const struct sctp_association *asoc, ...@@ -6231,7 +6231,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
/* We are going to ABORT, so we might as well stop /* We are going to ABORT, so we might as well stop
* processing the rest of the chunks in the packet. * processing the rest of the chunks in the packet.
*/ */
sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
SCTP_ERROR(ECONNABORTED)); SCTP_ERROR(ECONNABORTED));
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
......
...@@ -1568,7 +1568,7 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -1568,7 +1568,7 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct net *net = sock_net(sk); struct net *net = sock_net(sk);
struct sctp_sock *sp; struct sctp_sock *sp;
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
struct sctp_association *new_asoc=NULL, *asoc=NULL; struct sctp_association *new_asoc = NULL, *asoc = NULL;
struct sctp_transport *transport, *chunk_tp; struct sctp_transport *transport, *chunk_tp;
struct sctp_chunk *chunk; struct sctp_chunk *chunk;
union sctp_addr to; union sctp_addr to;
...@@ -2462,7 +2462,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk, ...@@ -2462,7 +2462,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk,
int hb_change, pmtud_change, sackdelay_change; int hb_change, pmtud_change, sackdelay_change;
if (optlen != sizeof(struct sctp_paddrparams)) if (optlen != sizeof(struct sctp_paddrparams))
return - EINVAL; return -EINVAL;
if (copy_from_user(&params, optval, optlen)) if (copy_from_user(&params, optval, optlen))
return -EFAULT; return -EFAULT;
...@@ -2483,7 +2483,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk, ...@@ -2483,7 +2483,7 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk,
/* If an address other than INADDR_ANY is specified, and /* If an address other than INADDR_ANY is specified, and
* no transport is found, then the request is invalid. * no transport is found, then the request is invalid.
*/ */
if (!sctp_is_any(sk, ( union sctp_addr *)&params.spp_address)) { if (!sctp_is_any(sk, (union sctp_addr *)&params.spp_address)) {
trans = sctp_addr_id2transport(sk, &params.spp_address, trans = sctp_addr_id2transport(sk, &params.spp_address,
params.spp_assoc_id); params.spp_assoc_id);
if (!trans) if (!trans)
...@@ -2588,7 +2588,7 @@ static int sctp_setsockopt_delayed_ack(struct sock *sk, ...@@ -2588,7 +2588,7 @@ static int sctp_setsockopt_delayed_ack(struct sock *sk,
else else
params.sack_freq = 0; params.sack_freq = 0;
} else } else
return - EINVAL; return -EINVAL;
/* Validate value parameter. */ /* Validate value parameter. */
if (params.sack_delay > 500) if (params.sack_delay > 500)
...@@ -3332,7 +3332,7 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk, ...@@ -3332,7 +3332,7 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk,
if (optlen < sizeof(struct sctp_hmacalgo)) if (optlen < sizeof(struct sctp_hmacalgo))
return -EINVAL; return -EINVAL;
hmacs= memdup_user(optval, optlen); hmacs = memdup_user(optval, optlen);
if (IS_ERR(hmacs)) if (IS_ERR(hmacs))
return PTR_ERR(hmacs); return PTR_ERR(hmacs);
...@@ -3370,7 +3370,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk, ...@@ -3370,7 +3370,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk,
if (optlen <= sizeof(struct sctp_authkey)) if (optlen <= sizeof(struct sctp_authkey))
return -EINVAL; return -EINVAL;
authkey= memdup_user(optval, optlen); authkey = memdup_user(optval, optlen);
if (IS_ERR(authkey)) if (IS_ERR(authkey))
return PTR_ERR(authkey); return PTR_ERR(authkey);
...@@ -4467,7 +4467,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len, ...@@ -4467,7 +4467,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len,
/* If an address other than INADDR_ANY is specified, and /* If an address other than INADDR_ANY is specified, and
* no transport is found, then the request is invalid. * no transport is found, then the request is invalid.
*/ */
if (!sctp_is_any(sk, ( union sctp_addr *)&params.spp_address)) { if (!sctp_is_any(sk, (union sctp_addr *)&params.spp_address)) {
trans = sctp_addr_id2transport(sk, &params.spp_address, trans = sctp_addr_id2transport(sk, &params.spp_address,
params.spp_assoc_id); params.spp_assoc_id);
if (!trans) { if (!trans) {
...@@ -4578,7 +4578,7 @@ static int sctp_getsockopt_delayed_ack(struct sock *sk, int len, ...@@ -4578,7 +4578,7 @@ static int sctp_getsockopt_delayed_ack(struct sock *sk, int len,
if (copy_from_user(&params, optval, len)) if (copy_from_user(&params, optval, len))
return -EFAULT; return -EFAULT;
} else } else
return - EINVAL; return -EINVAL;
/* Get association, if sack_assoc_id != 0 and the socket is a one /* Get association, if sack_assoc_id != 0 and the socket is a one
* to many style socket, and an association was not found, then * 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,8 +4668,8 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
if (!asoc) if (!asoc)
return -EINVAL; return -EINVAL;
to = optval + offsetof(struct sctp_getaddrs,addrs); to = optval + offsetof(struct sctp_getaddrs, addrs);
space_left = len - offsetof(struct sctp_getaddrs,addrs); space_left = len - offsetof(struct sctp_getaddrs, addrs);
list_for_each_entry(from, &asoc->peer.transport_addr_list, list_for_each_entry(from, &asoc->peer.transport_addr_list,
transports) { transports) {
...@@ -4729,7 +4729,7 @@ static int sctp_copy_laddrs(struct sock *sk, __u16 port, void *to, ...@@ -4729,7 +4729,7 @@ static int sctp_copy_laddrs(struct sock *sk, __u16 port, void *to,
memcpy(to, &temp, addrlen); memcpy(to, &temp, addrlen);
to += addrlen; to += addrlen;
cnt ++; cnt++;
space_left -= addrlen; space_left -= addrlen;
*bytes_copied += addrlen; *bytes_copied += addrlen;
} }
...@@ -4778,8 +4778,8 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, ...@@ -4778,8 +4778,8 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
bp = &asoc->base.bind_addr; bp = &asoc->base.bind_addr;
} }
to = optval + offsetof(struct sctp_getaddrs,addrs); to = optval + offsetof(struct sctp_getaddrs, addrs);
space_left = len - offsetof(struct sctp_getaddrs,addrs); space_left = len - offsetof(struct sctp_getaddrs, addrs);
addrs = kmalloc(space_left, GFP_KERNEL); addrs = kmalloc(space_left, GFP_KERNEL);
if (!addrs) if (!addrs)
...@@ -4818,7 +4818,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len, ...@@ -4818,7 +4818,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
memcpy(buf, &temp, addrlen); memcpy(buf, &temp, addrlen);
buf += addrlen; buf += addrlen;
bytes_copied += addrlen; bytes_copied += addrlen;
cnt ++; cnt++;
space_left -= addrlen; space_left -= addrlen;
} }
...@@ -5090,7 +5090,7 @@ static int sctp_getsockopt_associnfo(struct sock *sk, int len, ...@@ -5090,7 +5090,7 @@ static int sctp_getsockopt_associnfo(struct sock *sk, int len,
assocparams.sasoc_cookie_life = ktime_to_ms(asoc->cookie_life); assocparams.sasoc_cookie_life = ktime_to_ms(asoc->cookie_life);
list_for_each(pos, &asoc->peer.transport_addr_list) { list_for_each(pos, &asoc->peer.transport_addr_list) {
cnt ++; cnt++;
} }
assocparams.sasoc_number_peer_destinations = cnt; assocparams.sasoc_number_peer_destinations = cnt;
......
...@@ -107,7 +107,7 @@ int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk, ...@@ -107,7 +107,7 @@ int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
event = sctp_ulpq_reasm(ulpq, event); event = sctp_ulpq_reasm(ulpq, event);
/* Do ordering if needed. */ /* Do ordering if needed. */
if ((event) && (event->msg_flags & MSG_EOR)){ if ((event) && (event->msg_flags & MSG_EOR)) {
/* Create a temporary list to collect chunks on. */ /* Create a temporary list to collect chunks on. */
skb_queue_head_init(&temp); skb_queue_head_init(&temp);
__skb_queue_tail(&temp, sctp_event2skb(event)); __skb_queue_tail(&temp, sctp_event2skb(event));
...@@ -726,7 +726,7 @@ static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq) ...@@ -726,7 +726,7 @@ static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq)
while ((event = sctp_ulpq_retrieve_reassembled(ulpq)) != NULL) { while ((event = sctp_ulpq_retrieve_reassembled(ulpq)) != NULL) {
/* Do ordering if needed. */ /* Do ordering if needed. */
if ((event) && (event->msg_flags & MSG_EOR)){ if ((event) && (event->msg_flags & MSG_EOR)) {
skb_queue_head_init(&temp); skb_queue_head_init(&temp);
__skb_queue_tail(&temp, sctp_event2skb(event)); __skb_queue_tail(&temp, sctp_event2skb(event));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment