summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_input.c
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2012-09-07 13:36:42 +0000
committertuexen <tuexen@FreeBSD.org>2012-09-07 13:36:42 +0000
commit001c4aa6c4c64ee9584fbef16f7b2626cf58c41f (patch)
tree2b50fc66148c3a4c3c7d753a1a47f53a85ada046 /sys/netinet/sctp_input.c
parent8c350d556986bd03d0410ee97f632c768c05d5b7 (diff)
downloadFreeBSD-src-001c4aa6c4c64ee9584fbef16f7b2626cf58c41f.zip
FreeBSD-src-001c4aa6c4c64ee9584fbef16f7b2626cf58c41f.tar.gz
Don't include a structure containing a flexible array in another
structure. MFC after: 10 days
Diffstat (limited to 'sys/netinet/sctp_input.c')
-rw-r--r--sys/netinet/sctp_input.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index b3a551c..36aabfd 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -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 @@ process_control_chunks:
*/
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);
OpenPOWER on IntegriCloud