Fix a bug introduced by the implementation of I-DATA support.

There was the requirement that two structures are in sync,
which is not valid anymore. Therefore don't rely on this
in the code anymore.
Thanks to Radek Malcic for reporting the issue. He found this
when using the userland stack.

MFC after: 1 week
This commit is contained in:
tuexen 2016-05-13 09:11:41 +00:00
parent 180c16997b
commit 962273e9ec
2 changed files with 10 additions and 7 deletions

View File

@ -452,11 +452,6 @@ struct sctp_tmit_chunk {
uint8_t window_probe;
};
/*
* The first part of this structure MUST be the entire sinfo structure. Maybe
* I should have made it a sub structure... we can circle back later and do
* that if we want.
*/
struct sctp_queued_to_read { /* sinfo structure Pluse more */
uint16_t sinfo_stream; /* off the wire */
uint32_t sinfo_ssn; /* off the wire */

View File

@ -5545,8 +5545,16 @@ found_one:
stcb->asoc.strmin[control->sinfo_stream].delivery_started = 1;
}
/* First lets get off the sinfo and sockaddr info */
if ((sinfo) && filling_sinfo) {
memcpy(sinfo, control, sizeof(struct sctp_nonpad_sndrcvinfo));
if ((sinfo != NULL) && (filling_sinfo != 0)) {
sinfo->sinfo_stream = control->sinfo_stream;
sinfo->sinfo_ssn = (uint16_t) control->sinfo_ssn;
sinfo->sinfo_flags = control->sinfo_flags;
sinfo->sinfo_ppid = control->sinfo_ppid;
sinfo->sinfo_context = control->sinfo_context;
sinfo->sinfo_timetolive = control->sinfo_timetolive;
sinfo->sinfo_tsn = control->sinfo_tsn;
sinfo->sinfo_cumtsn = control->sinfo_cumtsn;
sinfo->sinfo_assoc_id = control->sinfo_assoc_id;
nxt = TAILQ_NEXT(control, next);
if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO) ||
sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO)) {