[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADvbK_ekPqeApqFQx6fT_pJy4_3vFW0aLbsLeabUrSRM6bchtg@mail.gmail.com>
Date: Wed, 8 Jun 2016 18:42:25 +0800
From: Xin Long <lucien.xin@...il.com>
To: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Cc: network dev <netdev@...r.kernel.org>, linux-sctp@...r.kernel.org,
Vlad Yasevich <vyasevich@...il.com>, daniel@...earbox.net,
davem <davem@...emloft.net>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCHv2 net-next] sctp: sctp should change socket state when
shutdown is received
On Tue, Jun 7, 2016 at 7:03 PM, Xin Long <lucien.xin@...il.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.
Powered by blists - more mailing lists