Commit 15328d9f authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: remove the typedef sctp_supported_ext_param_t

This patch is to remove the typedef sctp_supported_ext_param_t, and
replace with struct sctp_supported_ext_param in the places where it's
using this typedef.

It is also to use sizeof(variable) instead of sizeof(type).
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 85f6bd24
...@@ -309,10 +309,10 @@ struct sctp_adaptation_ind_param { ...@@ -309,10 +309,10 @@ struct sctp_adaptation_ind_param {
}; };
/* ADDIP Section 4.2.7 Supported Extensions Parameter */ /* ADDIP Section 4.2.7 Supported Extensions Parameter */
typedef struct sctp_supported_ext_param { struct sctp_supported_ext_param {
struct sctp_paramhdr param_hdr; struct sctp_paramhdr param_hdr;
__u8 chunks[0]; __u8 chunks[0];
} sctp_supported_ext_param_t; };
/* AUTH Section 3.1 Random */ /* AUTH Section 3.1 Random */
typedef struct sctp_random_param { typedef struct sctp_random_param {
......
...@@ -226,7 +226,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, ...@@ -226,7 +226,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
struct sctp_supported_addrs_param sat; struct sctp_supported_addrs_param sat;
__be16 types[2]; __be16 types[2];
struct sctp_adaptation_ind_param aiparam; struct sctp_adaptation_ind_param aiparam;
sctp_supported_ext_param_t ext_param; struct sctp_supported_ext_param ext_param;
int num_ext = 0; int num_ext = 0;
__u8 extensions[3]; __u8 extensions[3];
struct sctp_paramhdr *auth_chunks = NULL, struct sctp_paramhdr *auth_chunks = NULL,
...@@ -305,8 +305,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, ...@@ -305,8 +305,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
/* If we have any extensions to report, account for that */ /* If we have any extensions to report, account for that */
if (num_ext) if (num_ext)
chunksize += SCTP_PAD4(sizeof(sctp_supported_ext_param_t) + chunksize += SCTP_PAD4(sizeof(ext_param) + num_ext);
num_ext);
/* RFC 2960 3.3.2 Initiation (INIT) (1) /* RFC 2960 3.3.2 Initiation (INIT) (1)
* *
...@@ -348,10 +347,8 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, ...@@ -348,10 +347,8 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
*/ */
if (num_ext) { if (num_ext) {
ext_param.param_hdr.type = SCTP_PARAM_SUPPORTED_EXT; ext_param.param_hdr.type = SCTP_PARAM_SUPPORTED_EXT;
ext_param.param_hdr.length = ext_param.param_hdr.length = htons(sizeof(ext_param) + num_ext);
htons(sizeof(sctp_supported_ext_param_t) + num_ext); sctp_addto_chunk(retval, sizeof(ext_param), &ext_param);
sctp_addto_chunk(retval, sizeof(sctp_supported_ext_param_t),
&ext_param);
sctp_addto_param(retval, num_ext, extensions); sctp_addto_param(retval, num_ext, extensions);
} }
...@@ -394,7 +391,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, ...@@ -394,7 +391,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
int cookie_len; int cookie_len;
size_t chunksize; size_t chunksize;
struct sctp_adaptation_ind_param aiparam; struct sctp_adaptation_ind_param aiparam;
sctp_supported_ext_param_t ext_param; struct sctp_supported_ext_param ext_param;
int num_ext = 0; int num_ext = 0;
__u8 extensions[3]; __u8 extensions[3];
struct sctp_paramhdr *auth_chunks = NULL, struct sctp_paramhdr *auth_chunks = NULL,
...@@ -468,8 +465,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, ...@@ -468,8 +465,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
} }
if (num_ext) if (num_ext)
chunksize += SCTP_PAD4(sizeof(sctp_supported_ext_param_t) + chunksize += SCTP_PAD4(sizeof(ext_param) + num_ext);
num_ext);
/* Now allocate and fill out the chunk. */ /* Now allocate and fill out the chunk. */
retval = sctp_make_control(asoc, SCTP_CID_INIT_ACK, 0, chunksize, gfp); retval = sctp_make_control(asoc, SCTP_CID_INIT_ACK, 0, chunksize, gfp);
...@@ -495,10 +491,8 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, ...@@ -495,10 +491,8 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
sctp_addto_chunk(retval, sizeof(ecap_param), &ecap_param); sctp_addto_chunk(retval, sizeof(ecap_param), &ecap_param);
if (num_ext) { if (num_ext) {
ext_param.param_hdr.type = SCTP_PARAM_SUPPORTED_EXT; ext_param.param_hdr.type = SCTP_PARAM_SUPPORTED_EXT;
ext_param.param_hdr.length = ext_param.param_hdr.length = htons(sizeof(ext_param) + num_ext);
htons(sizeof(sctp_supported_ext_param_t) + num_ext); sctp_addto_chunk(retval, sizeof(ext_param), &ext_param);
sctp_addto_chunk(retval, sizeof(sctp_supported_ext_param_t),
&ext_param);
sctp_addto_param(retval, num_ext, extensions); sctp_addto_param(retval, num_ext, extensions);
} }
if (asoc->peer.prsctp_capable) if (asoc->peer.prsctp_capable)
......
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