Skip to content

Commit 4ae70c0

Browse files
lxindavem330
authored andcommitted
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: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9f8d314 commit 4ae70c0

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎include/linux/sctp.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,18 +257,18 @@ enum { SCTP_DATA_FRAG_MASK = 0x03, };
257257
* This chunk is used to initiate a SCTP association between two
258258
* endpoints.
259259
*/
260-
typedef struct sctp_inithdr {
260+
struct sctp_inithdr {
261261
__be32 init_tag;
262262
__be32 a_rwnd;
263263
__be16 num_outbound_streams;
264264
__be16 num_inbound_streams;
265265
__be32 initial_tsn;
266266
__u8 params[0];
267-
} sctp_inithdr_t;
267+
};
268268

269269
typedef struct sctp_init_chunk {
270270
struct sctp_chunkhdr chunk_hdr;
271-
sctp_inithdr_t init_hdr;
271+
struct sctp_inithdr init_hdr;
272272
} sctp_init_chunk_t;
273273

274274

‎net/netfilter/nf_conntrack_proto_sctp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ static int sctp_packet(struct nf_conn *ct,
395395
/* If it is an INIT or an INIT ACK note down the vtag */
396396
if (sch->type == SCTP_CID_INIT ||
397397
sch->type == SCTP_CID_INIT_ACK) {
398-
sctp_inithdr_t _inithdr, *ih;
398+
struct sctp_inithdr _inithdr, *ih;
399399

400400
ih = skb_header_pointer(skb, offset + sizeof(_sch),
401401
sizeof(_inithdr), &_inithdr);
@@ -471,7 +471,7 @@ static bool sctp_new(struct nf_conn *ct, const struct sk_buff *skb,
471471

472472
/* Copy the vtag into the state info */
473473
if (sch->type == SCTP_CID_INIT) {
474-
sctp_inithdr_t _inithdr, *ih;
474+
struct sctp_inithdr _inithdr, *ih;
475475
/* Sec 8.5.1 (A) */
476476
if (sh->vtag)
477477
return false;

‎net/sctp/sm_make_chunk.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
217217
{
218218
struct net *net = sock_net(asoc->base.sk);
219219
struct sctp_endpoint *ep = asoc->ep;
220-
sctp_inithdr_t init;
220+
struct sctp_inithdr init;
221221
union sctp_params addrs;
222222
size_t chunksize;
223223
struct sctp_chunk *retval = NULL;
@@ -385,7 +385,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
385385
const struct sctp_chunk *chunk,
386386
gfp_t gfp, int unkparam_len)
387387
{
388-
sctp_inithdr_t initack;
388+
struct sctp_inithdr initack;
389389
struct sctp_chunk *retval;
390390
union sctp_params addrs;
391391
struct sctp_sock *sp;

‎net/sctp/sm_statefuns.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,10 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net,
389389
}
390390

391391
/* Grab the INIT header. */
392-
chunk->subh.init_hdr = (sctp_inithdr_t *)chunk->skb->data;
392+
chunk->subh.init_hdr = (struct sctp_inithdr *)chunk->skb->data;
393393

394394
/* Tag the variable length parameters. */
395-
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(sctp_inithdr_t));
395+
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr));
396396

397397
new_asoc = sctp_make_temp_asoc(ep, chunk, GFP_ATOMIC);
398398
if (!new_asoc)
@@ -522,7 +522,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
522522
return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
523523
commands);
524524
/* Grab the INIT header. */
525-
chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data;
525+
chunk->subh.init_hdr = (struct sctp_inithdr *)chunk->skb->data;
526526

527527
/* Verify the INIT chunk before processing it. */
528528
err_chunk = NULL;
@@ -576,7 +576,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
576576
/* Tag the variable length parameters. Note that we never
577577
* convert the parameters in an INIT chunk.
578578
*/
579-
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(sctp_inithdr_t));
579+
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr));
580580

581581
initchunk = (sctp_init_chunk_t *) chunk->chunk_hdr;
582582

@@ -1454,10 +1454,10 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
14541454
return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
14551455
commands);
14561456
/* Grab the INIT header. */
1457-
chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data;
1457+
chunk->subh.init_hdr = (struct sctp_inithdr *)chunk->skb->data;
14581458

14591459
/* Tag the variable length parameters. */
1460-
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(sctp_inithdr_t));
1460+
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr));
14611461

14621462
/* Verify the INIT chunk before processing it. */
14631463
err_chunk = NULL;

0 commit comments

Comments
 (0)