Commit 978aa047 authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: fix some type cast warnings introduced since very beginning

These warnings were found by running 'make C=2 M=net/sctp/'.
They are there since very beginning.

Note after this patch, there still one warning left in
sctp_outq_flush():
  sctp_chunk_fail(chunk, SCTP_ERROR_INV_STRM)

Since it has been moved to sctp_stream_outq_migrate on net-next,
to avoid the extra job when merging net-next to net, I will post
the fix for it after the merging is done.
Reported-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f6fc6bc0
...@@ -231,7 +231,7 @@ struct sctp_datahdr { ...@@ -231,7 +231,7 @@ struct sctp_datahdr {
__be32 tsn; __be32 tsn;
__be16 stream; __be16 stream;
__be16 ssn; __be16 ssn;
__be32 ppid; __u32 ppid;
__u8 payload[0]; __u8 payload[0];
}; };
......
...@@ -376,7 +376,7 @@ struct sctp_remote_error { ...@@ -376,7 +376,7 @@ struct sctp_remote_error {
__u16 sre_type; __u16 sre_type;
__u16 sre_flags; __u16 sre_flags;
__u32 sre_length; __u32 sre_length;
__u16 sre_error; __be16 sre_error;
sctp_assoc_t sre_assoc_id; sctp_assoc_t sre_assoc_id;
__u8 sre_data[0]; __u8 sre_data[0];
}; };
......
...@@ -738,7 +738,7 @@ static int sctp_v6_skb_iif(const struct sk_buff *skb) ...@@ -738,7 +738,7 @@ static int sctp_v6_skb_iif(const struct sk_buff *skb)
/* Was this packet marked by Explicit Congestion Notification? */ /* Was this packet marked by Explicit Congestion Notification? */
static int sctp_v6_is_ce(const struct sk_buff *skb) static int sctp_v6_is_ce(const struct sk_buff *skb)
{ {
return *((__u32 *)(ipv6_hdr(skb))) & htonl(1 << 20); return *((__u32 *)(ipv6_hdr(skb))) & (__force __u32)htonl(1 << 20);
} }
/* Dump the v6 addr to the seq file. */ /* Dump the v6 addr to the seq file. */
......
...@@ -2854,7 +2854,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc, ...@@ -2854,7 +2854,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
addr_param_len = af->to_addr_param(addr, &addr_param); addr_param_len = af->to_addr_param(addr, &addr_param);
param.param_hdr.type = flags; param.param_hdr.type = flags;
param.param_hdr.length = htons(paramlen + addr_param_len); param.param_hdr.length = htons(paramlen + addr_param_len);
param.crr_id = i; param.crr_id = htonl(i);
sctp_addto_chunk(retval, paramlen, &param); sctp_addto_chunk(retval, paramlen, &param);
sctp_addto_chunk(retval, addr_param_len, &addr_param); sctp_addto_chunk(retval, addr_param_len, &addr_param);
...@@ -2867,7 +2867,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc, ...@@ -2867,7 +2867,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
addr_param_len = af->to_addr_param(addr, &addr_param); addr_param_len = af->to_addr_param(addr, &addr_param);
param.param_hdr.type = SCTP_PARAM_DEL_IP; param.param_hdr.type = SCTP_PARAM_DEL_IP;
param.param_hdr.length = htons(paramlen + addr_param_len); param.param_hdr.length = htons(paramlen + addr_param_len);
param.crr_id = i; param.crr_id = htonl(i);
sctp_addto_chunk(retval, paramlen, &param); sctp_addto_chunk(retval, paramlen, &param);
sctp_addto_chunk(retval, addr_param_len, &addr_param); sctp_addto_chunk(retval, addr_param_len, &addr_param);
......
...@@ -1607,12 +1607,12 @@ static int sctp_cmd_interpreter(enum sctp_event event_type, ...@@ -1607,12 +1607,12 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
break; break;
case SCTP_CMD_INIT_FAILED: case SCTP_CMD_INIT_FAILED:
sctp_cmd_init_failed(commands, asoc, cmd->obj.err); sctp_cmd_init_failed(commands, asoc, cmd->obj.u32);
break; break;
case SCTP_CMD_ASSOC_FAILED: case SCTP_CMD_ASSOC_FAILED:
sctp_cmd_assoc_failed(commands, asoc, event_type, sctp_cmd_assoc_failed(commands, asoc, event_type,
subtype, chunk, cmd->obj.err); subtype, chunk, cmd->obj.u32);
break; break;
case SCTP_CMD_INIT_COUNTER_INC: case SCTP_CMD_INIT_COUNTER_INC:
......
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