Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Feb 2026 14:37:11 -0800
From:      Gleb Smirnoff <glebius@freebsd.org>
To:        Michael Tuexen <tuexen@freebsd.org>
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:  <aYPKF8GrI1SGYBIw@cell.glebi.us>
In-Reply-To: <C48CD49C-FD93-466D-B872-516517D01606@FreeBSD.org>
References:  <697e46e9.2271d.66b41ecf@gitrepo.freebsd.org> <aYD6xx5874LTOG9B@cell.glebi.us> <C48CD49C-FD93-466D-B872-516517D01606@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

On Tue, Feb 03, 2026 at 08:24:10PM +0100, Michael Tuexen wrote:
M> > M>   VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p",
M> > M>      __func__, __LINE__, head));
M> > M> + KASSERT(head->so_type == SOCK_SEQPACKET,
M> > M> +    ("%s: unexpecte so_type: %d", __func__, head->so_type));
M> > M>   so = soalloc(head->so_vnet);
M> > M>   if (so == NULL) {
M> > M>   log(LOG_DEBUG, "%s: pcb %p: New socket allocation failure: "
M> > M> @@ -1311,7 +1313,7 @@ sopeeloff(struct socket *head)
M> > M>      __func__, head->so_pcb);
M> > M>   return (NULL);
M> > M>   }
M> > M> - so->so_type = head->so_type;
M> > M> + so->so_type = SOCK_STREAM;
M> > M>   so->so_options = head->so_options;
M> > M>   so->so_linger = head->so_linger;
M> > M>   so->so_state = (head->so_state & SS_NBIO) | SS_ISCONNECTED;
M> > 
M> > This creates a socket where:
M> > 
M> > so->so_type != so->so_proto->pr_type.
M> > 
M> > I'm not sure this is a good idea.  I was actually looking into removing so_type
M> > at all.  What does SCTP idea is about this peel-off thing?  If the resulting
M> > socket is a stream one, shouldn't its so_proto point at sctp_stream_protosw?
M> Yes, that makes sense.
M> But this is now a generic routine (I think it was an SCTP specific one in the past),
M> how can I refer to it without using sctp_stream_protosw?

It was never generic, albeit put into generic file.  It lives under #ifdef
SCTP. I'm all for moving it entirely into SCTP related file.

-- 
Gleb Smirnoff


home | help

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