Commit 4ae70c08 authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: remove the typedef sctp_inithdr_t

This patch is to remove the typedef sctp_inithdr_t, and replace
with struct sctp_inithdr in the places where it's using this
typedef.
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9f8d3147
...@@ -257,18 +257,18 @@ enum { SCTP_DATA_FRAG_MASK = 0x03, }; ...@@ -257,18 +257,18 @@ enum { SCTP_DATA_FRAG_MASK = 0x03, };
* This chunk is used to initiate a SCTP association between two * This chunk is used to initiate a SCTP association between two
* endpoints. * endpoints.
*/ */
typedef struct sctp_inithdr { struct sctp_inithdr {
__be32 init_tag; __be32 init_tag;
__be32 a_rwnd; __be32 a_rwnd;
__be16 num_outbound_streams; __be16 num_outbound_streams;
__be16 num_inbound_streams; __be16 num_inbound_streams;
__be32 initial_tsn; __be32 initial_tsn;
__u8 params[0]; __u8 params[0];
} sctp_inithdr_t; };
typedef struct sctp_init_chunk { typedef struct sctp_init_chunk {
struct sctp_chunkhdr chunk_hdr; struct sctp_chunkhdr chunk_hdr;
sctp_inithdr_t init_hdr; struct sctp_inithdr init_hdr;
} sctp_init_chunk_t; } sctp_init_chunk_t;
......
...@@ -395,7 +395,7 @@ static int sctp_packet(struct nf_conn *ct, ...@@ -395,7 +395,7 @@ static int sctp_packet(struct nf_conn *ct,
/* If it is an INIT or an INIT ACK note down the vtag */ /* If it is an INIT or an INIT ACK note down the vtag */
if (sch->type == SCTP_CID_INIT || if (sch->type == SCTP_CID_INIT ||
sch->type == SCTP_CID_INIT_ACK) { sch->type == SCTP_CID_INIT_ACK) {
sctp_inithdr_t _inithdr, *ih; struct sctp_inithdr _inithdr, *ih;
ih = skb_header_pointer(skb, offset + sizeof(_sch), ih = skb_header_pointer(skb, offset + sizeof(_sch),
sizeof(_inithdr), &_inithdr); sizeof(_inithdr), &_inithdr);
...@@ -471,7 +471,7 @@ static bool sctp_new(struct nf_conn *ct, const struct sk_buff *skb, ...@@ -471,7 +471,7 @@ static bool sctp_new(struct nf_conn *ct, const struct sk_buff *skb,
/* Copy the vtag into the state info */ /* Copy the vtag into the state info */
if (sch->type == SCTP_CID_INIT) { if (sch->type == SCTP_CID_INIT) {
sctp_inithdr_t _inithdr, *ih; struct sctp_inithdr _inithdr, *ih;
/* Sec 8.5.1 (A) */ /* Sec 8.5.1 (A) */
if (sh->vtag) if (sh->vtag)
return false; return false;
......
...@@ -217,7 +217,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, ...@@ -217,7 +217,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
{ {
struct net *net = sock_net(asoc->base.sk); struct net *net = sock_net(asoc->base.sk);
struct sctp_endpoint *ep = asoc->ep; struct sctp_endpoint *ep = asoc->ep;
sctp_inithdr_t init; struct sctp_inithdr init;
union sctp_params addrs; union sctp_params addrs;
size_t chunksize; size_t chunksize;
struct sctp_chunk *retval = NULL; struct sctp_chunk *retval = NULL;
...@@ -385,7 +385,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, ...@@ -385,7 +385,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
const struct sctp_chunk *chunk, const struct sctp_chunk *chunk,
gfp_t gfp, int unkparam_len) gfp_t gfp, int unkparam_len)
{ {
sctp_inithdr_t initack; struct sctp_inithdr initack;
struct sctp_chunk *retval; struct sctp_chunk *retval;
union sctp_params addrs; union sctp_params addrs;
struct sctp_sock *sp; struct sctp_sock *sp;
......
...@@ -389,10 +389,10 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net, ...@@ -389,10 +389,10 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net,
} }
/* Grab the INIT header. */ /* Grab the INIT header. */
chunk->subh.init_hdr = (sctp_inithdr_t *)chunk->skb->data; chunk->subh.init_hdr = (struct sctp_inithdr *)chunk->skb->data;
/* Tag the variable length parameters. */ /* Tag the variable length parameters. */
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(sctp_inithdr_t)); chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr));
new_asoc = sctp_make_temp_asoc(ep, chunk, GFP_ATOMIC); new_asoc = sctp_make_temp_asoc(ep, chunk, GFP_ATOMIC);
if (!new_asoc) if (!new_asoc)
...@@ -522,7 +522,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net, ...@@ -522,7 +522,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(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);
/* Grab the INIT header. */ /* Grab the INIT header. */
chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data; chunk->subh.init_hdr = (struct sctp_inithdr *)chunk->skb->data;
/* Verify the INIT chunk before processing it. */ /* Verify the INIT chunk before processing it. */
err_chunk = NULL; err_chunk = NULL;
...@@ -576,7 +576,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net, ...@@ -576,7 +576,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
/* Tag the variable length parameters. Note that we never /* Tag the variable length parameters. Note that we never
* convert the parameters in an INIT chunk. * convert the parameters in an INIT chunk.
*/ */
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(sctp_inithdr_t)); chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr));
initchunk = (sctp_init_chunk_t *) chunk->chunk_hdr; initchunk = (sctp_init_chunk_t *) chunk->chunk_hdr;
...@@ -1454,10 +1454,10 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( ...@@ -1454,10 +1454,10 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
commands); commands);
/* Grab the INIT header. */ /* Grab the INIT header. */
chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data; chunk->subh.init_hdr = (struct sctp_inithdr *)chunk->skb->data;
/* Tag the variable length parameters. */ /* Tag the variable length parameters. */
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(sctp_inithdr_t)); chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr));
/* Verify the INIT chunk before processing it. */ /* Verify the INIT chunk before processing it. */
err_chunk = NULL; err_chunk = NULL;
......
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