From owner-svn-src-all@freebsd.org Fri May 13 09:11:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEF33B39A60; Fri, 13 May 2016 09:11:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68A7D193F; Fri, 13 May 2016 09:11:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9BfeH077567; Fri, 13 May 2016 09:11:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9BfxH077565; Fri, 13 May 2016 09:11:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605130911.u4D9BfxH077565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 13 May 2016 09:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299637 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2016 09:11:42 -0000 Author: tuexen Date: Fri May 13 09:11:41 2016 New Revision: 299637 URL: https://svnweb.freebsd.org/changeset/base/299637 Log: 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 Modified: head/sys/netinet/sctp_structs.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Fri May 13 09:07:42 2016 (r299636) +++ head/sys/netinet/sctp_structs.h Fri May 13 09:11:41 2016 (r299637) @@ -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 */ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri May 13 09:07:42 2016 (r299636) +++ head/sys/netinet/sctputil.c Fri May 13 09:11:41 2016 (r299637) @@ -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)) {