Date: Fri, 6 Feb 2026 11:26:52 +0100 From: Michael Tuexen <tuexen@FreeBSD.org> To: Gleb Smirnoff <glebius@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: <0A0F4504-8243-4B11-880B-89A1BDAAB3BF@FreeBSD.org> In-Reply-To: <aYPKF8GrI1SGYBIw@cell.glebi.us> References: <697e46e9.2271d.66b41ecf@gitrepo.freebsd.org> <aYD6xx5874LTOG9B@cell.glebi.us> <C48CD49C-FD93-466D-B872-516517D01606@FreeBSD.org> <aYPKF8GrI1SGYBIw@cell.glebi.us>
index | next in thread | previous in thread | raw e-mail
> On 4. Feb 2026, at 23:37, Gleb Smirnoff <glebius@FreeBSD.org> wrote:
>
> 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.
OK. Let me see how to fix it.
Best regards
Michael
>
> --
> Gleb Smirnoff
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0A0F4504-8243-4B11-880B-89A1BDAAB3BF>
