summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctputil.c
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2016-05-13 09:11:41 +0000
committertuexen <tuexen@FreeBSD.org>2016-05-13 09:11:41 +0000
commit962273e9ec5329ac98be101db87240ee43b32a6e (patch)
tree1dedb87431bbc10d2350912ad9db5eae89904516 /sys/netinet/sctputil.c
parent180c16997b184b979d172bfac6f517c7a9a2f3a4 (diff)
downloadFreeBSD-src-962273e9ec5329ac98be101db87240ee43b32a6e.zip
FreeBSD-src-962273e9ec5329ac98be101db87240ee43b32a6e.tar.gz
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
Diffstat (limited to 'sys/netinet/sctputil.c')
-rw-r--r--sys/netinet/sctputil.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index b7b2c27..cc18d9f 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -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)) {
OpenPOWER on IntegriCloud