All of lore.kernel.org
 help / color / mirror / Atom feed
* Problems with peeled-off sockets
@ 2020-02-20  9:18 Leppanen, Jere (Nokia - FI/Espoo)
  2020-02-22  6:55 ` Xin Long
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Leppanen, Jere (Nokia - FI/Espoo) @ 2020-02-20  9:18 UTC (permalink / raw)
  To: linux-sctp

Hello All,

According to the RFC, a peeled-off socket is a one-to-one socket. But in lksctp a peeled-off socket it not TCP style, it's UDP_HIGH_BANDWIDTH style. Because of this, shutdown() doesn't work, linger probably doesn't work, and so on.

For example, in sctp_shutdown():

static void sctp_shutdown(struct sock *sk, int how)
{
        struct net *net = sock_net(sk);
        struct sctp_endpoint *ep;

        if (!sctp_style(sk, TCP))
                return;

Here we just bail out, because a peeled-off socket is not TCP style.

Is this just a bug, or am I missing something? Asking mostly out of personal curiosity.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with peeled-off sockets
  2020-02-20  9:18 Problems with peeled-off sockets Leppanen, Jere (Nokia - FI/Espoo)
@ 2020-02-22  6:55 ` Xin Long
  2020-02-24 19:28 ` Leppanen, Jere (Nokia - FI/Espoo)
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Xin Long @ 2020-02-22  6:55 UTC (permalink / raw)
  To: linux-sctp

On Thu, Feb 20, 2020 at 5:18 PM Leppanen, Jere (Nokia - FI/Espoo)
<jere.leppanen@nokia.com> wrote:
>
> Hello All,
>
> According to the RFC, a peeled-off socket is a one-to-one socket. But in lksctp a peeled-off socket it not TCP style, it's UDP_HIGH_BANDWIDTH style. Because of this, shutdown() doesn't work, linger probably doesn't work, and so on.
>
> For example, in sctp_shutdown():
>
> static void sctp_shutdown(struct sock *sk, int how)
> {
>         struct net *net = sock_net(sk);
>         struct sctp_endpoint *ep;
>
>         if (!sctp_style(sk, TCP))
>                 return;
>
> Here we just bail out, because a peeled-off socket is not TCP style.
>
> Is this just a bug, or am I missing something? Asking mostly out of personal curiosity.
I would say, it's because .shutdown is tcp_prot thing and udp_prot doesn't
have. sctp doesn't have to implement it for UDP style socket. But for TCP-
style socket, sctp is trying to be compatible with TCP protocol user API.
But even though,  sctp's .shutdown is still not fully compatible with TCP
protocol due to sctp's 3-way shakehands for finishing a connection.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with peeled-off sockets
  2020-02-20  9:18 Problems with peeled-off sockets Leppanen, Jere (Nokia - FI/Espoo)
  2020-02-22  6:55 ` Xin Long
@ 2020-02-24 19:28 ` Leppanen, Jere (Nokia - FI/Espoo)
  2020-02-27 15:58 ` Xin Long
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Leppanen, Jere (Nokia - FI/Espoo) @ 2020-02-24 19:28 UTC (permalink / raw)
  To: linux-sctp

On Sat, 22 Feb 2020, Xin Long wrote:

> On Thu, Feb 20, 2020 at 5:18 PM Leppanen, Jere (Nokia - FI/Espoo)
> <jere.leppanen@nokia.com> wrote:
>>
>> Hello All,
>> 
>> According to the RFC, a peeled-off socket is a one-to-one socket. But 
>> in lksctp a peeled-off socket it not TCP style, it's UDP_HIGH_BANDWIDTH
>> style. Because of this, shutdown() doesn't work, linger probably
>> doesn't work, and so on.
>> 
>> For example, in sctp_shutdown():
>>         
>> static void sctp_shutdown(struct sock *sk, int how)
>> {       
>>         struct net *net = sock_net(sk);
>>         struct sctp_endpoint *ep;
>>                 
>>         if (!sctp_style(sk, TCP))
>>                 return;
>> 
>> Here we just bail out, because a peeled-off socket is not TCP style.
>>
>> Is this just a bug, or am I missing something? Asking mostly out of 
>> personal curiosity.
> I would say, it's because .shutdown is tcp_prot thing and udp_prot doesn't
> have. sctp doesn't have to implement it for UDP style socket. But for TCP-
> style socket, sctp is trying to be compatible with TCP protocol user API. 
> But even though,  sctp's .shutdown is still not fully compatible with TCP
> protocol due to sctp's 3-way shakehands for finishing a connection.

Thanks a bunch for replying, Xin Long. I'm not quite sure what you mean. 
The actual association shutdown doesn't even come into play here, since 
shutdown() doesn't do anything with peeled-off sockets.

If you mean that the current implementation of shutdown() might have 
some problems with peeled-off sockets; well, that's true, but I suppose 
that means that there's something to fix somewhere.

It looks like the reason for the peculiar socket style of peeled-off 
sockets is that they're created by copying from a one-to-many socket and 
modified a little to resemble a one-to-one socket. But this leads to 
problems in several places in the code. Is this just implementation that 
was never finalized?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with peeled-off sockets
  2020-02-20  9:18 Problems with peeled-off sockets Leppanen, Jere (Nokia - FI/Espoo)
  2020-02-22  6:55 ` Xin Long
  2020-02-24 19:28 ` Leppanen, Jere (Nokia - FI/Espoo)
@ 2020-02-27 15:58 ` Xin Long
  2020-02-28 13:57 ` Leppanen, Jere (Nokia - FI/Espoo)
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Xin Long @ 2020-02-27 15:58 UTC (permalink / raw)
  To: linux-sctp

On Tue, Feb 25, 2020 at 3:28 AM Leppanen, Jere (Nokia - FI/Espoo)
<jere.leppanen@nokia.com> wrote:
>
> On Sat, 22 Feb 2020, Xin Long wrote:
>
> > On Thu, Feb 20, 2020 at 5:18 PM Leppanen, Jere (Nokia - FI/Espoo)
> > <jere.leppanen@nokia.com> wrote:
> >>
> >> Hello All,
> >>
> >> According to the RFC, a peeled-off socket is a one-to-one socket. But
> >> in lksctp a peeled-off socket it not TCP style, it's UDP_HIGH_BANDWIDTH
> >> style. Because of this, shutdown() doesn't work, linger probably
> >> doesn't work, and so on.
> >>
> >> For example, in sctp_shutdown():
> >>
> >> static void sctp_shutdown(struct sock *sk, int how)
> >> {
> >>         struct net *net = sock_net(sk);
> >>         struct sctp_endpoint *ep;
> >>
> >>         if (!sctp_style(sk, TCP))
> >>                 return;
> >>
> >> Here we just bail out, because a peeled-off socket is not TCP style.
> >>
> >> Is this just a bug, or am I missing something? Asking mostly out of
> >> personal curiosity.
> > I would say, it's because .shutdown is tcp_prot thing and udp_prot doesn't
> > have. sctp doesn't have to implement it for UDP style socket. But for TCP-
> > style socket, sctp is trying to be compatible with TCP protocol user API.
> > But even though,  sctp's .shutdown is still not fully compatible with TCP
> > protocol due to sctp's 3-way shakehands for finishing a connection.
>
> Thanks a bunch for replying, Xin Long. I'm not quite sure what you mean.
> The actual association shutdown doesn't even come into play here, since
> shutdown() doesn't do anything with peeled-off sockets.
Hi,  Leppanen,
sorry for late.

SCTP has two types of sockets: UDP and TCP styles.
TCP style associations are not allowed to be peeled off.
only UDP style associations can be peeled off.

Then shutdown can only work for TCP style, this explains
why peeled-off sk can use shutdown.


>
> If you mean that the current implementation of shutdown() might have
> some problems with peeled-off sockets; well, that's true, but I suppose
> that means that there's something to fix somewhere.
I think it returns for peeled-off sockets (UDP style sockets) on purpose.
it's like why you want to use shutdown on a UDP socket?

>
> It looks like the reason for the peculiar socket style of peeled-off
> sockets is that they're created by copying from a one-to-many socket and
> modified a little to resemble a one-to-one socket. But this leads to
> problems in several places in the code. Is this just implementation that
> was never finalized?
Right, peeled-off will allow users to use a new sk to control that asoc.
but again, it's a feature UDP style socket.
any other problems have you seen?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with peeled-off sockets
  2020-02-20  9:18 Problems with peeled-off sockets Leppanen, Jere (Nokia - FI/Espoo)
                   ` (2 preceding siblings ...)
  2020-02-27 15:58 ` Xin Long
@ 2020-02-28 13:57 ` Leppanen, Jere (Nokia - FI/Espoo)
  2020-02-28 14:31 ` Xin Long
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Leppanen, Jere (Nokia - FI/Espoo) @ 2020-02-28 13:57 UTC (permalink / raw)
  To: linux-sctp

On Thu, 27 Feb 2020, Xin Long wrote:

> On Tue, Feb 25, 2020 at 3:28 AM Leppanen, Jere (Nokia - FI/Espoo)
> <jere.leppanen@nokia.com> wrote:
>>
>> On Sat, 22 Feb 2020, Xin Long wrote:
>>
>>> On Thu, Feb 20, 2020 at 5:18 PM Leppanen, Jere (Nokia - FI/Espoo)
>>> <jere.leppanen@nokia.com> wrote: 
>>>>
>>>> Hello All,
>>>>  
>>>> According to the RFC, a peeled-off socket is a one-to-one socket. But
>>>> in lksctp a peeled-off socket it not TCP style, it's UDP_HIGH_BANDWIDTH
>>>> style. Because of this, shutdown() doesn't work, linger probably
>>>> doesn't work, and so on.
>>>>                 
>>>> For example, in sctp_shutdown():
>>>> 
>>>> static void sctp_shutdown(struct sock *sk, int how)
>>>> {
>>>>         struct net *net = sock_net(sk);
>>>>         struct sctp_endpoint *ep;
>>>>
>>>>         if (!sctp_style(sk, TCP))
>>>>                 return;
>>>>
>>>> Here we just bail out, because a peeled-off socket is not TCP style.
>>>>
>>>> Is this just a bug, or am I missing something? Asking mostly out of  
>>>> personal curiosity.
>>> I would say, it's because .shutdown is tcp_prot thing and udp_prot doesn't
>>> have. sctp doesn't have to implement it for UDP style socket. But for TCP-
>>> style socket, sctp is trying to be compatible with TCP protocol user API.
>>> But even though,  sctp's .shutdown is still not fully compatible with TCP
>>> protocol due to sctp's 3-way shakehands for finishing a connection.
>>
>> Thanks a bunch for replying, Xin Long. I'm not quite sure what you mean.
>> The actual association shutdown doesn't even come into play here, since
>> shutdown() doesn't do anything with peeled-off sockets.
> Hi,  Leppanen,
> sorry for late.
> 
> SCTP has two types of sockets: UDP and TCP styles.
> TCP style associations are not allowed to be peeled off.
> only UDP style associations can be peeled off.
> 
> Then shutdown can only work for TCP style, this explains
> why peeled-off sk can use shutdown.
> 
>
>> 
>> If you mean that the current implementation of shutdown() might have
>> some problems with peeled-off sockets; well, that's true, but I suppose 
>> that means that there's something to fix somewhere.
> I think it returns for peeled-off sockets (UDP style sockets) on purpose.
> it's like why you want to use shutdown on a UDP socket?
> 
>>
>> It looks like the reason for the peculiar socket style of peeled-off
>> sockets is that they're created by copying from a one-to-many socket and
>> modified a little to resemble a one-to-one socket. But this leads to   
>> problems in several places in the code. Is this just implementation that
>> was never finalized?  
> Right, peeled-off will allow users to use a new sk to control that asoc.
> but again, it's a feature UDP style socket.
> any other problems have you seen?

To clarify, by "peeled-off socket" I mean a socket returned by
sctp_peeloff(). sctp_peeloff() takes as an argument a
one-to-many socket, and returns a one-to-one socket.

The RFC (https://tools.ietf.org/html/rfc6458#section-9.2)
clearly states about the socket returned by sctp_peeloff() that
"[...] the new socket is a one-to-one style socket."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with peeled-off sockets
  2020-02-20  9:18 Problems with peeled-off sockets Leppanen, Jere (Nokia - FI/Espoo)
                   ` (3 preceding siblings ...)
  2020-02-28 13:57 ` Leppanen, Jere (Nokia - FI/Espoo)
@ 2020-02-28 14:31 ` Xin Long
  2020-02-28 14:32 ` Xin Long
  2020-02-28 15:03 ` Michael Tuexen
  6 siblings, 0 replies; 8+ messages in thread
From: Xin Long @ 2020-02-28 14:31 UTC (permalink / raw)
  To: linux-sctp

On Fri, Feb 28, 2020 at 9:57 PM Leppanen, Jere (Nokia - FI/Espoo)
<jere.leppanen@nokia.com> wrote:
>
> On Thu, 27 Feb 2020, Xin Long wrote:
>
> > On Tue, Feb 25, 2020 at 3:28 AM Leppanen, Jere (Nokia - FI/Espoo)
> > <jere.leppanen@nokia.com> wrote:
> >>
> >> On Sat, 22 Feb 2020, Xin Long wrote:
> >>
> >>> On Thu, Feb 20, 2020 at 5:18 PM Leppanen, Jere (Nokia - FI/Espoo)
> >>> <jere.leppanen@nokia.com> wrote:
> >>>>
> >>>> Hello All,
> >>>>
> >>>> According to the RFC, a peeled-off socket is a one-to-one socket. But
> >>>> in lksctp a peeled-off socket it not TCP style, it's UDP_HIGH_BANDWIDTH
> >>>> style. Because of this, shutdown() doesn't work, linger probably
> >>>> doesn't work, and so on.
> >>>>
> >>>> For example, in sctp_shutdown():
> >>>>
> >>>> static void sctp_shutdown(struct sock *sk, int how)
> >>>> {
> >>>>         struct net *net = sock_net(sk);
> >>>>         struct sctp_endpoint *ep;
> >>>>
> >>>>         if (!sctp_style(sk, TCP))
> >>>>                 return;
> >>>>
> >>>> Here we just bail out, because a peeled-off socket is not TCP style.
> >>>>
> >>>> Is this just a bug, or am I missing something? Asking mostly out of
> >>>> personal curiosity.
> >>> I would say, it's because .shutdown is tcp_prot thing and udp_prot doesn't
> >>> have. sctp doesn't have to implement it for UDP style socket. But for TCP-
> >>> style socket, sctp is trying to be compatible with TCP protocol user API.
> >>> But even though,  sctp's .shutdown is still not fully compatible with TCP
> >>> protocol due to sctp's 3-way shakehands for finishing a connection.
> >>
> >> Thanks a bunch for replying, Xin Long. I'm not quite sure what you mean.
> >> The actual association shutdown doesn't even come into play here, since
> >> shutdown() doesn't do anything with peeled-off sockets.
> > Hi,  Leppanen,
> > sorry for late.
> >
> > SCTP has two types of sockets: UDP and TCP styles.
> > TCP style associations are not allowed to be peeled off.
> > only UDP style associations can be peeled off.
> >
> > Then shutdown can only work for TCP style, this explains
> > why peeled-off sk can use shutdown.
> >
> >
> >>
> >> If you mean that the current implementation of shutdown() might have
> >> some problems with peeled-off sockets; well, that's true, but I suppose
> >> that means that there's something to fix somewhere.
> > I think it returns for peeled-off sockets (UDP style sockets) on purpose.
> > it's like why you want to use shutdown on a UDP socket?
> >
> >>
> >> It looks like the reason for the peculiar socket style of peeled-off
> >> sockets is that they're created by copying from a one-to-many socket and
> >> modified a little to resemble a one-to-one socket. But this leads to
> >> problems in several places in the code. Is this just implementation that
> >> was never finalized?
> > Right, peeled-off will allow users to use a new sk to control that asoc.
> > but again, it's a feature UDP style socket.
> > any other problems have you seen?
>
> To clarify, by "peeled-off socket" I mean a socket returned by
> sctp_peeloff(). sctp_peeloff() takes as an argument a
> one-to-many socket, and returns a one-to-one socket.
>
> The RFC (https://tools.ietf.org/html/rfc6458#section-9.2)
> clearly states about the socket returned by sctp_peeloff() that
> "[...] the new socket is a one-to-one style socket."
OK, I got you now.
Linux creates a TCP/one-to-many style socket there actually.
Interesting, BSD seems to do the same.
I will double check and make a patch for this once confirmed.

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with peeled-off sockets
  2020-02-20  9:18 Problems with peeled-off sockets Leppanen, Jere (Nokia - FI/Espoo)
                   ` (4 preceding siblings ...)
  2020-02-28 14:31 ` Xin Long
@ 2020-02-28 14:32 ` Xin Long
  2020-02-28 15:03 ` Michael Tuexen
  6 siblings, 0 replies; 8+ messages in thread
From: Xin Long @ 2020-02-28 14:32 UTC (permalink / raw)
  To: linux-sctp

On Fri, Feb 28, 2020 at 10:31 PM Xin Long <lucien.xin@gmail.com> wrote:
>
> On Fri, Feb 28, 2020 at 9:57 PM Leppanen, Jere (Nokia - FI/Espoo)
> <jere.leppanen@nokia.com> wrote:
> >
> > On Thu, 27 Feb 2020, Xin Long wrote:
> >
> > > On Tue, Feb 25, 2020 at 3:28 AM Leppanen, Jere (Nokia - FI/Espoo)
> > > <jere.leppanen@nokia.com> wrote:
> > >>
> > >> On Sat, 22 Feb 2020, Xin Long wrote:
> > >>
> > >>> On Thu, Feb 20, 2020 at 5:18 PM Leppanen, Jere (Nokia - FI/Espoo)
> > >>> <jere.leppanen@nokia.com> wrote:
> > >>>>
> > >>>> Hello All,
> > >>>>
> > >>>> According to the RFC, a peeled-off socket is a one-to-one socket. But
> > >>>> in lksctp a peeled-off socket it not TCP style, it's UDP_HIGH_BANDWIDTH
> > >>>> style. Because of this, shutdown() doesn't work, linger probably
> > >>>> doesn't work, and so on.
> > >>>>
> > >>>> For example, in sctp_shutdown():
> > >>>>
> > >>>> static void sctp_shutdown(struct sock *sk, int how)
> > >>>> {
> > >>>>         struct net *net = sock_net(sk);
> > >>>>         struct sctp_endpoint *ep;
> > >>>>
> > >>>>         if (!sctp_style(sk, TCP))
> > >>>>                 return;
> > >>>>
> > >>>> Here we just bail out, because a peeled-off socket is not TCP style.
> > >>>>
> > >>>> Is this just a bug, or am I missing something? Asking mostly out of
> > >>>> personal curiosity.
> > >>> I would say, it's because .shutdown is tcp_prot thing and udp_prot doesn't
> > >>> have. sctp doesn't have to implement it for UDP style socket. But for TCP-
> > >>> style socket, sctp is trying to be compatible with TCP protocol user API.
> > >>> But even though,  sctp's .shutdown is still not fully compatible with TCP
> > >>> protocol due to sctp's 3-way shakehands for finishing a connection.
> > >>
> > >> Thanks a bunch for replying, Xin Long. I'm not quite sure what you mean.
> > >> The actual association shutdown doesn't even come into play here, since
> > >> shutdown() doesn't do anything with peeled-off sockets.
> > > Hi,  Leppanen,
> > > sorry for late.
> > >
> > > SCTP has two types of sockets: UDP and TCP styles.
> > > TCP style associations are not allowed to be peeled off.
> > > only UDP style associations can be peeled off.
> > >
> > > Then shutdown can only work for TCP style, this explains
> > > why peeled-off sk can use shutdown.
> > >
> > >
> > >>
> > >> If you mean that the current implementation of shutdown() might have
> > >> some problems with peeled-off sockets; well, that's true, but I suppose
> > >> that means that there's something to fix somewhere.
> > > I think it returns for peeled-off sockets (UDP style sockets) on purpose.
> > > it's like why you want to use shutdown on a UDP socket?
> > >
> > >>
> > >> It looks like the reason for the peculiar socket style of peeled-off
> > >> sockets is that they're created by copying from a one-to-many socket and
> > >> modified a little to resemble a one-to-one socket. But this leads to
> > >> problems in several places in the code. Is this just implementation that
> > >> was never finalized?
> > > Right, peeled-off will allow users to use a new sk to control that asoc.
> > > but again, it's a feature UDP style socket.
> > > any other problems have you seen?
> >
> > To clarify, by "peeled-off socket" I mean a socket returned by
> > sctp_peeloff(). sctp_peeloff() takes as an argument a
> > one-to-many socket, and returns a one-to-one socket.
> >
> > The RFC (https://tools.ietf.org/html/rfc6458#section-9.2)
> > clearly states about the socket returned by sctp_peeloff() that
> > "[...] the new socket is a one-to-one style socket."
> OK, I got you now.
> Linux creates a TCP/one-to-many style socket there actually.
sorry, UDP/one-to-many style.
> Interesting, BSD seems to do the same.
> I will double check and make a patch for this once confirmed.
>
> Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with peeled-off sockets
  2020-02-20  9:18 Problems with peeled-off sockets Leppanen, Jere (Nokia - FI/Espoo)
                   ` (5 preceding siblings ...)
  2020-02-28 14:32 ` Xin Long
@ 2020-02-28 15:03 ` Michael Tuexen
  6 siblings, 0 replies; 8+ messages in thread
From: Michael Tuexen @ 2020-02-28 15:03 UTC (permalink / raw)
  To: linux-sctp

> On 28. Feb 2020, at 15:31, Xin Long <lucien.xin@gmail.com> wrote:
> 
> On Fri, Feb 28, 2020 at 9:57 PM Leppanen, Jere (Nokia - FI/Espoo)
> <jere.leppanen@nokia.com> wrote:
>> 
>> On Thu, 27 Feb 2020, Xin Long wrote:
>> 
>>> On Tue, Feb 25, 2020 at 3:28 AM Leppanen, Jere (Nokia - FI/Espoo)
>>> <jere.leppanen@nokia.com> wrote:
>>>> 
>>>> On Sat, 22 Feb 2020, Xin Long wrote:
>>>> 
>>>>> On Thu, Feb 20, 2020 at 5:18 PM Leppanen, Jere (Nokia - FI/Espoo)
>>>>> <jere.leppanen@nokia.com> wrote:
>>>>>> 
>>>>>> Hello All,
>>>>>> 
>>>>>> According to the RFC, a peeled-off socket is a one-to-one socket. But
>>>>>> in lksctp a peeled-off socket it not TCP style, it's UDP_HIGH_BANDWIDTH
>>>>>> style. Because of this, shutdown() doesn't work, linger probably
>>>>>> doesn't work, and so on.
>>>>>> 
>>>>>> For example, in sctp_shutdown():
>>>>>> 
>>>>>> static void sctp_shutdown(struct sock *sk, int how)
>>>>>> {
>>>>>>        struct net *net = sock_net(sk);
>>>>>>        struct sctp_endpoint *ep;
>>>>>> 
>>>>>>        if (!sctp_style(sk, TCP))
>>>>>>                return;
>>>>>> 
>>>>>> Here we just bail out, because a peeled-off socket is not TCP style.
>>>>>> 
>>>>>> Is this just a bug, or am I missing something? Asking mostly out of
>>>>>> personal curiosity.
>>>>> I would say, it's because .shutdown is tcp_prot thing and udp_prot doesn't
>>>>> have. sctp doesn't have to implement it for UDP style socket. But for TCP-
>>>>> style socket, sctp is trying to be compatible with TCP protocol user API.
>>>>> But even though,  sctp's .shutdown is still not fully compatible with TCP
>>>>> protocol due to sctp's 3-way shakehands for finishing a connection.
>>>> 
>>>> Thanks a bunch for replying, Xin Long. I'm not quite sure what you mean.
>>>> The actual association shutdown doesn't even come into play here, since
>>>> shutdown() doesn't do anything with peeled-off sockets.
>>> Hi,  Leppanen,
>>> sorry for late.
>>> 
>>> SCTP has two types of sockets: UDP and TCP styles.
>>> TCP style associations are not allowed to be peeled off.
>>> only UDP style associations can be peeled off.
>>> 
>>> Then shutdown can only work for TCP style, this explains
>>> why peeled-off sk can use shutdown.
>>> 
>>> 
>>>> 
>>>> If you mean that the current implementation of shutdown() might have
>>>> some problems with peeled-off sockets; well, that's true, but I suppose
>>>> that means that there's something to fix somewhere.
>>> I think it returns for peeled-off sockets (UDP style sockets) on purpose.
>>> it's like why you want to use shutdown on a UDP socket?
>>> 
>>>> 
>>>> It looks like the reason for the peculiar socket style of peeled-off
>>>> sockets is that they're created by copying from a one-to-many socket and
>>>> modified a little to resemble a one-to-one socket. But this leads to
>>>> problems in several places in the code. Is this just implementation that
>>>> was never finalized?
>>> Right, peeled-off will allow users to use a new sk to control that asoc.
>>> but again, it's a feature UDP style socket.
>>> any other problems have you seen?
>> 
>> To clarify, by "peeled-off socket" I mean a socket returned by
>> sctp_peeloff(). sctp_peeloff() takes as an argument a
>> one-to-many socket, and returns a one-to-one socket.
>> 
>> The RFC (https://tools.ietf.org/html/rfc6458#section-9.2)
>> clearly states about the socket returned by sctp_peeloff() that
>> "[...] the new socket is a one-to-one style socket."
> OK, I got you now.
> Linux creates a TCP/one-to-many style socket there actually.
> Interesting, BSD seems to do the same.
> I will double check and make a patch for this once confirmed.
I would expect that the socket returned by sctp_peeloff() is
a one-to-one style socket and behave like one. If BSD is not
like this, it is a bug and I would like to know.

Best regards
Michael
> 
> Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-28 15:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20  9:18 Problems with peeled-off sockets Leppanen, Jere (Nokia - FI/Espoo)
2020-02-22  6:55 ` Xin Long
2020-02-24 19:28 ` Leppanen, Jere (Nokia - FI/Espoo)
2020-02-27 15:58 ` Xin Long
2020-02-28 13:57 ` Leppanen, Jere (Nokia - FI/Espoo)
2020-02-28 14:31 ` Xin Long
2020-02-28 14:32 ` Xin Long
2020-02-28 15:03 ` Michael Tuexen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.