netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	linux-sctp@vger.kernel.org, Vlad Yasevich <vyasevich@gmail.com>,
	daniel@iogearbox.net, davem <davem@davemloft.net>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCHv2 net-next] sctp: sctp should change socket state when shutdown is received
Date: Wed, 8 Jun 2016 09:05:58 -0300	[thread overview]
Message-ID: <6cdb1799-3e59-1f69-371c-a8737d336817@gmail.com> (raw)
In-Reply-To: <CADvbK_ekPqeApqFQx6fT_pJy4_3vFW0aLbsLeabUrSRM6bchtg@mail.gmail.com>

Em 08-06-2016 07:42, Xin Long escreveu:
> On Tue, Jun 7, 2016 at 7:03 PM, Xin Long <lucien.xin@gmail.com> wrote:
>> On Sat, Jun 4, 2016 at 8:22 PM, Marcelo Ricardo Leitner
>>
>> --- a/net/sctp/socket.c
>> +++ b/net/sctp/socket.c
>> @@ -7565,10 +7565,12 @@ static void sctp_sock_migrate(struct sock
>> *oldsk, struct sock *newsk,
>>         /* If the association on the newsk is already closed before accept()
>>          * is called, set RCV_SHUTDOWN flag.
>>          */
>> -       if (sctp_state(assoc, CLOSED) && sctp_style(newsk, TCP))
>> +       if (sctp_state(assoc, CLOSED) && sctp_style(newsk, TCP)) {
>> +               newsk->sk_state = SCTP_SS_CLOSING;
>>                 newsk->sk_shutdown |= RCV_SHUTDOWN;
>> +       } else
>> +               newsk->sk_state = SCTP_SS_ESTABLISHED;
>>
>> -       newsk->sk_state = SCTP_SS_ESTABLISHED;
>>
> I'm still thinking about this, if we want to get addrs info from
> closed assoc, like Adam's requirement. this will make it more
> impossible.
>
> case in
> sctp_getsockopt_peer_addrs()->sctp_id2assoc():
>
>                 if (!sctp_sstate(sk, ESTABLISHED))
>                         return NULL;
>
> we can't  get assoc as sstate is SS_CLOSING already.
>

We probably can add another state to that if(). So far ESTABLISHED was 
the only reasonable state in there, but SS_CLOSING will make sense too 
then, I guess. A throughout check is necessary for this.

   Marcelo

  reply	other threads:[~2016-06-08 12:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 14:42 [PATCHv2 net-next] sctp: sctp should change socket state when shutdown is received Xin Long
2016-06-03 17:49 ` Marcelo Ricardo Leitner
2016-06-04  9:45   ` Xin Long
2016-06-04 12:22     ` Marcelo Ricardo Leitner
2016-06-07 11:03       ` Xin Long
2016-06-07 12:08         ` Marcelo Ricardo Leitner
2016-06-08 10:17           ` Xin Long
2016-06-08 10:42         ` Xin Long
2016-06-08 12:05           ` Marcelo Ricardo Leitner [this message]
2016-06-06  3:12 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6cdb1799-3e59-1f69-371c-a8737d336817@gmail.com \
    --to=marcelo.leitner@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).