Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jun 2021 14:12:22 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 6587a2bd1e88 - main - sctp: Fix length check for ECNE chunks
Message-ID:  <202106271412.15RECMYX079576@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=6587a2bd1e88b5b99aea114e3d20b0d4c48c95df

commit 6587a2bd1e88b5b99aea114e3d20b0d4c48c95df
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2021-06-27 14:10:39 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2021-06-27 14:10:39 +0000

    sctp: Fix length check for ECNE chunks
    
    MFC after:      3 days
---
 sys/netinet/sctp_input.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 442e58afd0ff..b822c9eae2ca 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -2887,10 +2887,6 @@ sctp_handle_ecn_echo(struct sctp_ecne_chunk *cp,
 	unsigned int pkt_cnt;
 
 	len = ntohs(cp->ch.chunk_length);
-	if ((len != sizeof(struct sctp_ecne_chunk)) &&
-	    (len != sizeof(struct old_sctp_ecne_chunk))) {
-		return;
-	}
 	if (len == sizeof(struct old_sctp_ecne_chunk)) {
 		/* Its the old format */
 		memcpy(&bkup, cp, sizeof(struct old_sctp_ecne_chunk));
@@ -5022,7 +5018,8 @@ process_control_chunks:
 			if (stcb->asoc.ecn_supported == 0) {
 				goto unknown_chunk;
 			}
-			if (chk_length != sizeof(struct sctp_ecne_chunk)) {
+			if ((chk_length != sizeof(struct sctp_ecne_chunk)) &&
+			    (chk_length != sizeof(struct old_sctp_ecne_chunk))) {
 				break;
 			}
 			sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, stcb);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106271412.15RECMYX079576>