Don't include a structure containing a flexible array in another

structure.

MFC after:	10 days
This commit is contained in:
Michael Tuexen 2012-09-07 13:36:42 +00:00
parent d11ed2f6de
commit a169d6ec2b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=240198
5 changed files with 13 additions and 24 deletions

View File

@ -510,16 +510,6 @@ struct sctp_stream_reset_add_strm {
* streams then the request will need to be an overlay structure.
*/
struct sctp_stream_reset_out_req {
struct sctp_chunkhdr ch;
struct sctp_stream_reset_out_request sr_req;
} SCTP_PACKED;
struct sctp_stream_reset_in_req {
struct sctp_chunkhdr ch;
struct sctp_stream_reset_in_request sr_req;
} SCTP_PACKED;
struct sctp_stream_reset_tsn_req {
struct sctp_chunkhdr ch;
struct sctp_stream_reset_tsn_request sr_req;

View File

@ -2113,7 +2113,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
*/
struct sctp_queued_to_read *ctl, *nctl;
sctp_reset_in_stream(stcb, liste->number_entries, liste->req.list_of_streams);
sctp_reset_in_stream(stcb, liste->number_entries, liste->list_of_streams);
TAILQ_REMOVE(&asoc->resetHead, liste, next_resp);
SCTP_FREE(liste, SCTP_M_STRESET);
/* sa_ignore FREED_MEMORY */

View File

@ -3455,9 +3455,9 @@ process_chunk_drop(struct sctp_tcb *stcb, struct sctp_chunk_desc *desc,
}
void
sctp_reset_in_stream(struct sctp_tcb *stcb, int number_entries, uint16_t * list)
sctp_reset_in_stream(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list)
{
int i;
uint32_t i;
uint16_t temp;
/*
@ -3511,7 +3511,7 @@ struct sctp_stream_reset_out_request *
sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chunk **bchk)
{
struct sctp_association *asoc;
struct sctp_stream_reset_out_req *req;
struct sctp_chunkhdr *ch;
struct sctp_stream_reset_out_request *r;
struct sctp_tmit_chunk *chk;
int len, clen;
@ -3534,8 +3534,8 @@ sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chu
*bchk = chk;
}
clen = chk->send_size;
req = mtod(chk->data, struct sctp_stream_reset_out_req *);
r = &req->sr_req;
ch = mtod(chk->data, struct sctp_chunkhdr *);
r = (struct sctp_stream_reset_out_request *)(ch + 1);
if (ntohl(r->request_seq) == seq) {
/* found it */
return (r);
@ -3888,8 +3888,7 @@ sctp_handle_str_reset_request_out(struct sctp_tcb *stcb,
}
liste->tsn = tsn;
liste->number_entries = number_entries;
memcpy(&liste->req, req,
(sizeof(struct sctp_stream_reset_out_request) + (number_entries * sizeof(uint16_t))));
memcpy(&liste->list_of_streams, req->list_of_streams, number_entries * sizeof(uint16_t));
TAILQ_INSERT_TAIL(&asoc->resetHead, liste, next_resp);
asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
}
@ -4059,7 +4058,7 @@ __attribute__((noinline))
#endif
static int
sctp_handle_stream_reset(struct sctp_tcb *stcb, struct mbuf *m, int offset,
struct sctp_stream_reset_out_req *sr_req)
struct sctp_chunkhdr *ch_req)
{
int chk_length, param_len, ptype;
struct sctp_paramhdr pstore;
@ -4074,7 +4073,7 @@ __attribute__((noinline))
int num_param = 0;
/* now it may be a reset or a reset-response */
chk_length = ntohs(sr_req->ch.chunk_length);
chk_length = ntohs(ch_req->chunk_length);
/* setup for adding the response */
sctp_alloc_a_chunk(stcb, chk);
@ -5413,7 +5412,7 @@ __attribute__((noinline))
*/
stcb->asoc.peer_supports_strreset = 1;
}
if (sctp_handle_stream_reset(stcb, m, *offset, (struct sctp_stream_reset_out_req *)ch)) {
if (sctp_handle_stream_reset(stcb, m, *offset, ch)) {
/* stop processing */
*offset = length;
return (NULL);

View File

@ -53,7 +53,7 @@ sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq,
struct sctp_tmit_chunk **bchk);
void
sctp_reset_in_stream(struct sctp_tcb *stcb, int number_entries,
sctp_reset_in_stream(struct sctp_tcb *stcb, uint32_t number_entries,
uint16_t * list);

View File

@ -77,8 +77,8 @@ TAILQ_HEAD(sctpnetlisthead, sctp_nets);
struct sctp_stream_reset_list {
TAILQ_ENTRY(sctp_stream_reset_list) next_resp;
uint32_t tsn;
int number_entries;
struct sctp_stream_reset_out_request req;
uint32_t number_entries;
uint16_t list_of_streams[];
};
TAILQ_HEAD(sctp_resethead, sctp_stream_reset_list);