提交 01a992be 编写于 作者: X Xin Long 提交者: David S. Miller

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: NXin Long <lucien.xin@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4ae70c08
...@@ -266,10 +266,10 @@ struct sctp_inithdr { ...@@ -266,10 +266,10 @@ struct sctp_inithdr {
__u8 params[0]; __u8 params[0];
}; };
typedef struct sctp_init_chunk { struct sctp_init_chunk {
struct sctp_chunkhdr chunk_hdr; struct sctp_chunkhdr chunk_hdr;
struct sctp_inithdr init_hdr; struct sctp_inithdr init_hdr;
} sctp_init_chunk_t; };
/* Section 3.3.2.1. IPv4 Address Parameter (5) */ /* Section 3.3.2.1. IPv4 Address Parameter (5) */
...@@ -341,7 +341,7 @@ typedef struct sctp_hmac_algo_param { ...@@ -341,7 +341,7 @@ typedef struct sctp_hmac_algo_param {
* The INIT ACK chunk is used to acknowledge the initiation of an SCTP * The INIT ACK chunk is used to acknowledge the initiation of an SCTP
* association. * association.
*/ */
typedef sctp_init_chunk_t sctp_initack_chunk_t; typedef struct sctp_init_chunk sctp_initack_chunk_t;
/* Section 3.3.3.1 State Cookie (7) */ /* Section 3.3.3.1 State Cookie (7) */
typedef struct sctp_cookie_param { typedef struct sctp_cookie_param {
......
...@@ -132,7 +132,7 @@ typedef union { ...@@ -132,7 +132,7 @@ typedef union {
struct sctp_association *asoc; struct sctp_association *asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
struct sctp_bind_addr *bp; struct sctp_bind_addr *bp;
sctp_init_chunk_t *init; struct sctp_init_chunk *init;
struct sctp_ulpevent *ulpevent; struct sctp_ulpevent *ulpevent;
struct sctp_packet *packet; struct sctp_packet *packet;
sctp_sackhdr_t *sackh; sctp_sackhdr_t *sackh;
...@@ -173,7 +173,7 @@ SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) ...@@ -173,7 +173,7 @@ SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk)
SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc) SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc)
SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport) SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport)
SCTP_ARG_CONSTRUCTOR(BA, struct sctp_bind_addr *, bp) SCTP_ARG_CONSTRUCTOR(BA, struct sctp_bind_addr *, bp)
SCTP_ARG_CONSTRUCTOR(PEER_INIT, sctp_init_chunk_t *, init) SCTP_ARG_CONSTRUCTOR(PEER_INIT, struct sctp_init_chunk *, init)
SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent) SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent)
SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet)
SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh)
......
...@@ -1298,11 +1298,11 @@ int sctp_has_association(struct net *net, const union sctp_addr *laddr, ...@@ -1298,11 +1298,11 @@ int sctp_has_association(struct net *net, const union sctp_addr *laddr,
int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep, int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
enum sctp_cid cid, sctp_init_chunk_t *peer_init, enum sctp_cid cid, struct sctp_init_chunk *peer_init,
struct sctp_chunk *chunk, struct sctp_chunk **err_chunk); struct sctp_chunk *chunk, struct sctp_chunk **err_chunk);
int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk, int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk,
const union sctp_addr *peer, const union sctp_addr *peer,
sctp_init_chunk_t *init, gfp_t gfp); struct sctp_init_chunk *init, gfp_t gfp);
__u32 sctp_generate_tag(const struct sctp_endpoint *); __u32 sctp_generate_tag(const struct sctp_endpoint *);
__u32 sctp_generate_tsn(const struct sctp_endpoint *); __u32 sctp_generate_tsn(const struct sctp_endpoint *);
......
...@@ -1051,7 +1051,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct net *net, ...@@ -1051,7 +1051,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct net *net,
union sctp_addr *paddr = &addr; union sctp_addr *paddr = &addr;
struct sctphdr *sh = sctp_hdr(skb); struct sctphdr *sh = sctp_hdr(skb);
union sctp_params params; union sctp_params params;
sctp_init_chunk_t *init; struct sctp_init_chunk *init;
struct sctp_af *af; struct sctp_af *af;
/* /*
...@@ -1070,7 +1070,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct net *net, ...@@ -1070,7 +1070,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct net *net,
/* Find the start of the TLVs and the end of the chunk. This is /* Find the start of the TLVs and the end of the chunk. This is
* the region we search for address parameters. * the region we search for address parameters.
*/ */
init = (sctp_init_chunk_t *)skb->data; init = (struct sctp_init_chunk *)skb->data;
/* Walk the parameters looking for embedded addresses. */ /* Walk the parameters looking for embedded addresses. */
sctp_walk_params(params, init, init_hdr.params) { sctp_walk_params(params, init, init_hdr.params) {
......
...@@ -2242,8 +2242,8 @@ static sctp_ierror_t sctp_verify_param(struct net *net, ...@@ -2242,8 +2242,8 @@ static sctp_ierror_t sctp_verify_param(struct net *net,
/* Verify the INIT packet before we process it. */ /* Verify the INIT packet before we process it. */
int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep, int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
const struct sctp_association *asoc, enum sctp_cid cid, const struct sctp_association *asoc, enum sctp_cid cid,
sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk, struct sctp_init_chunk *peer_init,
struct sctp_chunk **errp) struct sctp_chunk *chunk, struct sctp_chunk **errp)
{ {
union sctp_params param; union sctp_params param;
bool has_cookie = false; bool has_cookie = false;
...@@ -2307,7 +2307,7 @@ int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep, ...@@ -2307,7 +2307,7 @@ int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
*/ */
int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk, int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk,
const union sctp_addr *peer_addr, const union sctp_addr *peer_addr,
sctp_init_chunk_t *peer_init, gfp_t gfp) struct sctp_init_chunk *peer_init, gfp_t gfp)
{ {
struct net *net = sock_net(asoc->base.sk); struct net *net = sock_net(asoc->base.sk);
union sctp_params param; union sctp_params param;
......
...@@ -647,7 +647,7 @@ static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands, ...@@ -647,7 +647,7 @@ static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands,
static int sctp_cmd_process_init(sctp_cmd_seq_t *commands, static int sctp_cmd_process_init(sctp_cmd_seq_t *commands,
struct sctp_association *asoc, struct sctp_association *asoc,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
sctp_init_chunk_t *peer_init, struct sctp_init_chunk *peer_init,
gfp_t gfp) gfp_t gfp)
{ {
int error; int error;
......
...@@ -345,7 +345,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net, ...@@ -345,7 +345,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net,
* error, but since we don't have an association, we'll * error, but since we don't have an association, we'll
* just discard the packet. * just discard the packet.
*/ */
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_init_chunk_t))) if (!sctp_chunk_length_valid(chunk, sizeof(struct sctp_init_chunk)))
return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
/* If the INIT is coming toward a closing socket, we'll send back /* 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, ...@@ -360,7 +360,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net,
/* Verify the INIT chunk before processing it. */ /* Verify the INIT chunk before processing it. */
err_chunk = NULL; err_chunk = NULL;
if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type, if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk, (struct sctp_init_chunk *)chunk->chunk_hdr, chunk,
&err_chunk)) { &err_chunk)) {
/* This chunk contains fatal error. It is to be discarded. /* This chunk contains fatal error. It is to be discarded.
* Send an ABORT, with causes if there is any. * 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, ...@@ -405,7 +405,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net,
/* The call, sctp_process_init(), can fail on memory allocation. */ /* The call, sctp_process_init(), can fail on memory allocation. */
if (!sctp_process_init(new_asoc, chunk, sctp_source(chunk), if (!sctp_process_init(new_asoc, chunk, sctp_source(chunk),
(sctp_init_chunk_t *)chunk->chunk_hdr, (struct sctp_init_chunk *)chunk->chunk_hdr,
GFP_ATOMIC)) GFP_ATOMIC))
goto nomem_init; goto nomem_init;
...@@ -503,7 +503,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net, ...@@ -503,7 +503,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
sctp_cmd_seq_t *commands) sctp_cmd_seq_t *commands)
{ {
struct sctp_chunk *chunk = arg; struct sctp_chunk *chunk = arg;
sctp_init_chunk_t *initchunk; struct sctp_init_chunk *initchunk;
struct sctp_chunk *err_chunk; struct sctp_chunk *err_chunk;
struct sctp_packet *packet; struct sctp_packet *packet;
...@@ -527,7 +527,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net, ...@@ -527,7 +527,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
/* Verify the INIT chunk before processing it. */ /* Verify the INIT chunk before processing it. */
err_chunk = NULL; err_chunk = NULL;
if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type, if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk, (struct sctp_init_chunk *)chunk->chunk_hdr, chunk,
&err_chunk)) { &err_chunk)) {
sctp_error_t error = SCTP_ERROR_NO_RESOURCE; sctp_error_t error = SCTP_ERROR_NO_RESOURCE;
...@@ -578,7 +578,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net, ...@@ -578,7 +578,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
*/ */
chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr)); chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr));
initchunk = (sctp_init_chunk_t *) chunk->chunk_hdr; initchunk = (struct sctp_init_chunk *)chunk->chunk_hdr;
sctp_add_cmd_sf(commands, SCTP_CMD_PEER_INIT, sctp_add_cmd_sf(commands, SCTP_CMD_PEER_INIT,
SCTP_PEER_INIT(initchunk)); SCTP_PEER_INIT(initchunk));
...@@ -653,7 +653,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net, ...@@ -653,7 +653,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net,
{ {
struct sctp_chunk *chunk = arg; struct sctp_chunk *chunk = arg;
struct sctp_association *new_asoc; struct sctp_association *new_asoc;
sctp_init_chunk_t *peer_init; struct sctp_init_chunk *peer_init;
struct sctp_chunk *repl; struct sctp_chunk *repl;
struct sctp_ulpevent *ev, *ai_ev = NULL; struct sctp_ulpevent *ev, *ai_ev = NULL;
int error = 0; int error = 0;
...@@ -1450,7 +1450,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( ...@@ -1450,7 +1450,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
* In this case, we generate a protocol violation since we have * In this case, we generate a protocol violation since we have
* an association established. * an association established.
*/ */
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_init_chunk_t))) if (!sctp_chunk_length_valid(chunk, sizeof(struct sctp_init_chunk)))
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. */
...@@ -1462,7 +1462,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( ...@@ -1462,7 +1462,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
/* Verify the INIT chunk before processing it. */ /* Verify the INIT chunk before processing it. */
err_chunk = NULL; err_chunk = NULL;
if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type, if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk, (struct sctp_init_chunk *)chunk->chunk_hdr, chunk,
&err_chunk)) { &err_chunk)) {
/* This chunk contains fatal error. It is to be discarded. /* This chunk contains fatal error. It is to be discarded.
* Send an ABORT, with causes if there is any. * Send an ABORT, with causes if there is any.
...@@ -1509,7 +1509,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( ...@@ -1509,7 +1509,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
* place (local tie-tag and per tie-tag) within the state cookie. * place (local tie-tag and per tie-tag) within the state cookie.
*/ */
if (!sctp_process_init(new_asoc, chunk, sctp_source(chunk), if (!sctp_process_init(new_asoc, chunk, sctp_source(chunk),
(sctp_init_chunk_t *)chunk->chunk_hdr, (struct sctp_init_chunk *)chunk->chunk_hdr,
GFP_ATOMIC)) GFP_ATOMIC))
goto nomem; goto nomem;
...@@ -1730,7 +1730,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(struct net *net, ...@@ -1730,7 +1730,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(struct net *net,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
struct sctp_association *new_asoc) struct sctp_association *new_asoc)
{ {
sctp_init_chunk_t *peer_init; struct sctp_init_chunk *peer_init;
struct sctp_ulpevent *ev; struct sctp_ulpevent *ev;
struct sctp_chunk *repl; struct sctp_chunk *repl;
struct sctp_chunk *err; struct sctp_chunk *err;
...@@ -1845,7 +1845,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(struct net *net, ...@@ -1845,7 +1845,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(struct net *net,
sctp_cmd_seq_t *commands, sctp_cmd_seq_t *commands,
struct sctp_association *new_asoc) struct sctp_association *new_asoc)
{ {
sctp_init_chunk_t *peer_init; struct sctp_init_chunk *peer_init;
struct sctp_chunk *repl; struct sctp_chunk *repl;
/* new_asoc is a brand-new association, so these are not yet /* 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, ...@@ -6124,9 +6124,9 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net,
switch (chunk->chunk_hdr->type) { switch (chunk->chunk_hdr->type) {
case SCTP_CID_INIT: case SCTP_CID_INIT:
{ {
sctp_init_chunk_t *init; struct sctp_init_chunk *init;
init = (sctp_init_chunk_t *)chunk->chunk_hdr; init = (struct sctp_init_chunk *)chunk->chunk_hdr;
vtag = ntohl(init->init_hdr.init_tag); vtag = ntohl(init->init_hdr.init_tag);
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册