From nobody Mon Feb 2 19:28:07 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f4c8q05rkz6QQ3Y; Mon, 02 Feb 2026 19:28:11 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f4c8p6dmQz3tCw; Mon, 02 Feb 2026 19:28:10 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770060490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rnBQS6Drl0rgOnLTjRf2YelDV0ez2ijYrFpunhjb274=; b=yUULO2uc/uP6soNK3UfiVDLTMONzkqC98V5GTkNesbf7cs7qyMY27swOulV44mTAND2Jwf 978O73pWdOx4Rdjt3JmCz4dAEa//aAXYzdX8PNCFBb+eOkfiDDYf54znL7kTCx+RyO3mcW 4V9nPLd7VG4Dc6nRpTmBrDJuDbtuSVjjcKZNalqfRNqpEQ9wJJI2EpVRmdmieJ7xexanBP ynYvcYbfBN+7KMtU5s0GzWwH296tr3y5hXx7asCl+no/xsl4juMXTGZcye8ksXG+sKoPs0 8hydsAItpae8V8p8XR9b5jFo1p53uo9U8fe+V69LVz5wGSmXcKvS7YNxGLqBZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770060490; a=rsa-sha256; cv=none; b=Fixm4JGfNKPRCDpsXKEGq4CYcvT2O+GKMEnBVs2s1JZvVAGmx2bc9zyiin+t+4nBexn6yP Jk+x5ZhWpYm1tY9w+9T6dzT3wqJquE2khwebl5/VKSyK7c3oE+D3ALINOAj8/knFG5hd+A 733iDfa0u/6PPBQN5uK0WRG221C7a8RH7hdEKCILEHGaCDJHwaAdWNwJDcwbtnHsZ3fynb /OKYmH73h5T0bsfzc4p7GNIW3FHRURKw/KBeyW329TtJu7w6dQjLv4kBK/C43qD7FWtzlL jPUHkdlfq1o3uUHRvpBTRTb+x81PkZsd1JJaMmjkZyjBhaTg5kWUW57bJwj6cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770060490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rnBQS6Drl0rgOnLTjRf2YelDV0ez2ijYrFpunhjb274=; b=t30OWvjW4JXLh6Tk0iPxWCqq98xRzdLeeb7+FEWDv/5kk7EU45TgrMP95fMV2wW2MQTRX7 TUzsGMaWUcT7s94InDvDx0c8C79TXeEjLPAk8RJOvRia4dE9ZkFWzD3GH0UCJMZ3S+Qr79 qqQ30TSYgHs12cbUvK/wTyB8zZK5zvtC8l73S/JK1bV/Get4Oftx+ABWZUiFit5eSsZO1a DCdUJRc4n+vBuIPq0MK0b0aNXSvumwxq0SMasZcXFmlNGN78kUAAwL0xSqMnT6loR+KWSg pt9OI5ariNrEY60eEPr+wYp4pwFPZdWWfBnwg3jemUGfOfmKNHdYu3z4CW15eQ== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4f4c8p20Blzmhq; Mon, 02 Feb 2026 19:28:10 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Mon, 2 Feb 2026 11:28:07 -0800 From: Gleb Smirnoff To: Michael Tuexen Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d195b3783fa4 - main - sctp: fix socket type created by sctp_peeloff() Message-ID: References: <697e46e9.2271d.66b41ecf@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <697e46e9.2271d.66b41ecf@gitrepo.freebsd.org> Michael, On Sat, Jan 31, 2026 at 06:16:09PM +0000, Michael Tuexen wrote: M> commit d195b3783fa4de5c1a95f6d95eb9444abce6778b M> Author: Michael Tuexen M> AuthorDate: 2026-01-31 18:11:08 +0000 M> Commit: Michael Tuexen M> CommitDate: 2026-01-31 18:11:08 +0000 M> M> sctp: fix socket type created by sctp_peeloff() M> M> When calling sctp_peeloff() on a SOCK_SEQPACKET socket, the created M> and returned socket has the type SOCK_STREAM. M> This is specified in section 9.2 of RFC 6458. M> M> Reported by: Xin Long M> MFC after: 3 days M> --- M> sys/kern/uipc_socket.c | 6 ++++-- M> 1 file changed, 4 insertions(+), 2 deletions(-) M> M> diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c M> index efc8ebfcece2..4014006ce2e5 100644 M> --- a/sys/kern/uipc_socket.c M> +++ b/sys/kern/uipc_socket.c M> @@ -1292,7 +1292,7 @@ solisten_enqueue(struct socket *so, int connstatus) M> M> #if defined(SCTP) || defined(SCTP_SUPPORT) M> /* M> - * Socket part of sctp_peeloff(). Detach a new socket from an M> + * Socket part of sctp_peeloff(). Create a new socket for an M> * association. The new socket is returned with a reference. M> * M> * XXXGL: reduce copy-paste with solisten_clone(). M> @@ -1304,6 +1304,8 @@ sopeeloff(struct socket *head) M> M> VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p", M> __func__, __LINE__, head)); M> + KASSERT(head->so_type == SOCK_SEQPACKET, M> + ("%s: unexpecte so_type: %d", __func__, head->so_type)); M> so = soalloc(head->so_vnet); M> if (so == NULL) { M> log(LOG_DEBUG, "%s: pcb %p: New socket allocation failure: " M> @@ -1311,7 +1313,7 @@ sopeeloff(struct socket *head) M> __func__, head->so_pcb); M> return (NULL); M> } M> - so->so_type = head->so_type; M> + so->so_type = SOCK_STREAM; M> so->so_options = head->so_options; M> so->so_linger = head->so_linger; M> so->so_state = (head->so_state & SS_NBIO) | SS_ISCONNECTED; This creates a socket where: so->so_type != so->so_proto->pr_type. I'm not sure this is a good idea. I was actually looking into removing so_type at all. What does SCTP idea is about this peel-off thing? If the resulting socket is a stream one, shouldn't its so_proto point at sctp_stream_protosw? -- Gleb Smirnoff