From owner-dev-commits-src-main@freebsd.org Tue Sep 7 21:12:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F21866C242; Tue, 7 Sep 2021 21:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3ydz2VCBz4Vn1; Tue, 7 Sep 2021 21:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10C1E19AB7; Tue, 7 Sep 2021 21:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LCcli023502; Tue, 7 Sep 2021 21:12:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LCcUw023501; Tue, 7 Sep 2021 21:12:38 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:12:38 GMT Message-Id: <202109072112.187LCcUw023501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c4b44adcf0b6 - main - sctp: Remove special handling for a listen(2) backlog of 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4b44adcf0b631eb2d4187f285ed37cf4ce1caff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:12:39 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c4b44adcf0b631eb2d4187f285ed37cf4ce1caff commit c4b44adcf0b631eb2d4187f285ed37cf4ce1caff Author: Mark Johnston AuthorDate: 2021-09-07 18:51:19 +0000 Commit: Mark Johnston CommitDate: 2021-09-07 21:12:09 +0000 sctp: Remove special handling for a listen(2) backlog of 0 ... when applied to one-to-one-style sockets. sctp_listen() cannot be used to toggle the listening state of such a socket. See RFC 6458's description of expected listen(2) semantics for one-to-one- and one-to-many-style sockets. Reviewed by: tuexen MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31774 --- sys/netinet/sctp_usrreq.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 76d73a11304a..516e58753163 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -7249,14 +7249,16 @@ sctp_listen(struct socket *so, int backlog, struct thread *p) } if ((inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) == 0) { solisten_proto(so, backlog); - } else { - solisten_proto_abort(so); - } - SOCK_UNLOCK(so); - if (backlog > 0) { + SOCK_UNLOCK(so); inp->sctp_flags |= SCTP_PCB_FLAGS_ACCEPTING; } else { - inp->sctp_flags &= ~SCTP_PCB_FLAGS_ACCEPTING; + solisten_proto_abort(so); + SOCK_UNLOCK(so); + if (backlog > 0) { + inp->sctp_flags |= SCTP_PCB_FLAGS_ACCEPTING; + } else { + inp->sctp_flags &= ~SCTP_PCB_FLAGS_ACCEPTING; + } } out: SCTP_INP_WUNLOCK(inp);