Skip to content

Commit 01a992b

Browse files
lxindavem330
authored andcommitted
sctp: remove the typedef sctp_init_chunk_t
This patch is to remove the typedef sctp_init_chunk_t, and replace with struct sctp_init_chunk 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 4ae70c0 commit 01a992b

7 files changed

Lines changed: 27 additions & 27 deletions

File tree

‎include/linux/sctp.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,10 @@ struct sctp_inithdr {
266266
__u8 params[0];
267267
};
268268

269-
typedef struct sctp_init_chunk {
269+
struct sctp_init_chunk {
270270
struct sctp_chunkhdr chunk_hdr;
271271
struct sctp_inithdr init_hdr;
272-
} sctp_init_chunk_t;
272+
};
273273

274274

275275
/* Section 3.3.2.1. IPv4 Address Parameter (5) */
@@ -341,7 +341,7 @@ typedef struct sctp_hmac_algo_param {
341341
* The INIT ACK chunk is used to acknowledge the initiation of an SCTP
342342
* association.
343343
*/
344-
typedef sctp_init_chunk_t sctp_initack_chunk_t;
344+
typedef struct sctp_init_chunk sctp_initack_chunk_t;
345345

346346
/* Section 3.3.3.1 State Cookie (7) */
347347
typedef struct sctp_cookie_param {

‎include/net/sctp/command.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ typedef union {
132132
struct sctp_association *asoc;
133133
struct sctp_transport *transport;
134134
struct sctp_bind_addr *bp;
135-
sctp_init_chunk_t *init;
135+
struct sctp_init_chunk *init;
136136
struct sctp_ulpevent *ulpevent;
137137
struct sctp_packet *packet;
138138
sctp_sackhdr_t *sackh;
@@ -173,7 +173,7 @@ SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk)
173173
SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc)
174174
SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport)
175175
SCTP_ARG_CONSTRUCTOR(BA, struct sctp_bind_addr *, bp)
176-
SCTP_ARG_CONSTRUCTOR(PEER_INIT, sctp_init_chunk_t *, init)
176+
SCTP_ARG_CONSTRUCTOR(PEER_INIT, struct sctp_init_chunk *, init)
177177
SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent)
178178
SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet)
179179
SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh)

‎include/net/sctp/structs.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,11 +1298,11 @@ int sctp_has_association(struct net *net, const union sctp_addr *laddr,
12981298

12991299
int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
13001300
const struct sctp_association *asoc,
1301-
enum sctp_cid cid, sctp_init_chunk_t *peer_init,
1301+
enum sctp_cid cid, struct sctp_init_chunk *peer_init,
13021302
struct sctp_chunk *chunk, struct sctp_chunk **err_chunk);
13031303
int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk,
13041304
const union sctp_addr *peer,
1305-
sctp_init_chunk_t *init, gfp_t gfp);
1305+
struct sctp_init_chunk *init, gfp_t gfp);
13061306
__u32 sctp_generate_tag(const struct sctp_endpoint *);
13071307
__u32 sctp_generate_tsn(const struct sctp_endpoint *);
13081308

‎net/sctp/input.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct net *net,
10511051
union sctp_addr *paddr = &addr;
10521052
struct sctphdr *sh = sctp_hdr(skb);
10531053
union sctp_params params;
1054-
sctp_init_chunk_t *init;
1054+
struct sctp_init_chunk *init;
10551055
struct sctp_af *af;
10561056

10571057
/*
@@ -1070,7 +1070,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct net *net,
10701070
/* Find the start of the TLVs and the end of the chunk. This is
10711071
* the region we search for address parameters.
10721072
*/
1073-
init = (sctp_init_chunk_t *)skb->data;
1073+
init = (struct sctp_init_chunk *)skb->data;
10741074

10751075
/* Walk the parameters looking for embedded addresses. */
10761076
sctp_walk_params(params, init, init_hdr.params) {

‎net/sctp/sm_make_chunk.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,8 +2242,8 @@ static sctp_ierror_t sctp_verify_param(struct net *net,
22422242
/* Verify the INIT packet before we process it. */
22432243
int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
22442244
const struct sctp_association *asoc, enum sctp_cid cid,
2245-
sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk,
2246-
struct sctp_chunk **errp)
2245+
struct sctp_init_chunk *peer_init,
2246+
struct sctp_chunk *chunk, struct sctp_chunk **errp)
22472247
{
22482248
union sctp_params param;
22492249
bool has_cookie = false;
@@ -2307,7 +2307,7 @@ int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
23072307
*/
23082308
int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk,
23092309
const union sctp_addr *peer_addr,
2310-
sctp_init_chunk_t *peer_init, gfp_t gfp)
2310+
struct sctp_init_chunk *peer_init, gfp_t gfp)
23112311
{
23122312
struct net *net = sock_net(asoc->base.sk);
23132313
union sctp_params param;

‎net/sctp/sm_sideeffect.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands,
647647
static int sctp_cmd_process_init(sctp_cmd_seq_t *commands,
648648
struct sctp_association *asoc,
649649
struct sctp_chunk *chunk,
650-
sctp_init_chunk_t *peer_init,
650+
struct sctp_init_chunk *peer_init,
651651
gfp_t gfp)
652652
{
653653
int error;

‎net/sctp/sm_statefuns.c‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net,
345345
* error, but since we don't have an association, we'll
346346
* just discard the packet.
347347
*/
348-
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_init_chunk_t)))
348+
if (!sctp_chunk_length_valid(chunk, sizeof(struct sctp_init_chunk)))
349349
return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
350350

351351
/* If the INIT is coming toward a closing socket, we'll send back
@@ -360,7 +360,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net,
360360
/* Verify the INIT chunk before processing it. */
361361
err_chunk = NULL;
362362
if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
363-
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
363+
(struct sctp_init_chunk *)chunk->chunk_hdr, chunk,
364364
&err_chunk)) {
365365
/* This chunk contains fatal error. It is to be discarded.
366366
* Send an ABORT, with causes if there is any.
@@ -405,7 +405,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net,
405405

406406
/* The call, sctp_process_init(), can fail on memory allocation. */
407407
if (!sctp_process_init(new_asoc, chunk, sctp_source(chunk),
408-
(sctp_init_chunk_t *)chunk->chunk_hdr,
408+
(struct sctp_init_chunk *)chunk->chunk_hdr,
409409
GFP_ATOMIC))
410410
goto nomem_init;
411411

@@ -503,7 +503,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
503503
sctp_cmd_seq_t *commands)
504504
{
505505
struct sctp_chunk *chunk = arg;
506-
sctp_init_chunk_t *initchunk;
506+
struct sctp_init_chunk *initchunk;
507507
struct sctp_chunk *err_chunk;
508508
struct sctp_packet *packet;
509509

@@ -527,7 +527,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
527527
/* Verify the INIT chunk before processing it. */
528528
err_chunk = NULL;
529529
if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
530-
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
530+
(struct sctp_init_chunk *)chunk->chunk_hdr, chunk,
531531
&err_chunk)) {
532532

533533
sctp_error_t error = SCTP_ERROR_NO_RESOURCE;
@@ -578,7 +578,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
578578
*/
579579
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr));
580580

581-
initchunk = (sctp_init_chunk_t *) chunk->chunk_hdr;
581+
initchunk = (struct sctp_init_chunk *)chunk->chunk_hdr;
582582

583583
sctp_add_cmd_sf(commands, SCTP_CMD_PEER_INIT,
584584
SCTP_PEER_INIT(initchunk));
@@ -653,7 +653,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net,
653653
{
654654
struct sctp_chunk *chunk = arg;
655655
struct sctp_association *new_asoc;
656-
sctp_init_chunk_t *peer_init;
656+
struct sctp_init_chunk *peer_init;
657657
struct sctp_chunk *repl;
658658
struct sctp_ulpevent *ev, *ai_ev = NULL;
659659
int error = 0;
@@ -1450,7 +1450,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
14501450
* In this case, we generate a protocol violation since we have
14511451
* an association established.
14521452
*/
1453-
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_init_chunk_t)))
1453+
if (!sctp_chunk_length_valid(chunk, sizeof(struct sctp_init_chunk)))
14541454
return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
14551455
commands);
14561456
/* Grab the INIT header. */
@@ -1462,7 +1462,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
14621462
/* Verify the INIT chunk before processing it. */
14631463
err_chunk = NULL;
14641464
if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
1465-
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
1465+
(struct sctp_init_chunk *)chunk->chunk_hdr, chunk,
14661466
&err_chunk)) {
14671467
/* This chunk contains fatal error. It is to be discarded.
14681468
* Send an ABORT, with causes if there is any.
@@ -1509,7 +1509,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
15091509
* place (local tie-tag and per tie-tag) within the state cookie.
15101510
*/
15111511
if (!sctp_process_init(new_asoc, chunk, sctp_source(chunk),
1512-
(sctp_init_chunk_t *)chunk->chunk_hdr,
1512+
(struct sctp_init_chunk *)chunk->chunk_hdr,
15131513
GFP_ATOMIC))
15141514
goto nomem;
15151515

@@ -1730,7 +1730,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(struct net *net,
17301730
sctp_cmd_seq_t *commands,
17311731
struct sctp_association *new_asoc)
17321732
{
1733-
sctp_init_chunk_t *peer_init;
1733+
struct sctp_init_chunk *peer_init;
17341734
struct sctp_ulpevent *ev;
17351735
struct sctp_chunk *repl;
17361736
struct sctp_chunk *err;
@@ -1845,7 +1845,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(struct net *net,
18451845
sctp_cmd_seq_t *commands,
18461846
struct sctp_association *new_asoc)
18471847
{
1848-
sctp_init_chunk_t *peer_init;
1848+
struct sctp_init_chunk *peer_init;
18491849
struct sctp_chunk *repl;
18501850

18511851
/* new_asoc is a brand-new association, so these are not yet
@@ -6124,9 +6124,9 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net,
61246124
switch (chunk->chunk_hdr->type) {
61256125
case SCTP_CID_INIT:
61266126
{
6127-
sctp_init_chunk_t *init;
6127+
struct sctp_init_chunk *init;
61286128

6129-
init = (sctp_init_chunk_t *)chunk->chunk_hdr;
6129+
init = (struct sctp_init_chunk *)chunk->chunk_hdr;
61306130
vtag = ntohl(init->init_hdr.init_tag);
61316131
break;
61326132
}

0 commit comments

Comments
 (0)