All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate
@ 2016-06-15 17:15 ` Xin Long
  0 siblings, 0 replies; 10+ messages in thread
From: Xin Long @ 2016-06-15 17:15 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: Marcelo Ricardo Leitner, Vlad Yasevich, daniel, xiaolong.ye,
	davem, eric.dumazet

Commit d46e416c11c8 ("sctp: sctp should change socket state when
shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
but inet_accept doesn't allow the sk_state other than ESTABLISHED/
CLOSED for sctp. So we will change sk_state to CLOSED, instead of
CLOSING, as actually sk is closed already there.

Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received")
Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 6cae4c6..cdabbd8 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -7568,7 +7568,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
 	 * is called, set RCV_SHUTDOWN flag.
 	 */
 	if (sctp_state(assoc, CLOSED) && sctp_style(newsk, TCP)) {
-		newsk->sk_state = SCTP_SS_CLOSING;
+		newsk->sk_state = SCTP_SS_CLOSED;
 		newsk->sk_shutdown |= RCV_SHUTDOWN;
 	} else {
 		newsk->sk_state = SCTP_SS_ESTABLISHED;
-- 
2.1.0

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

* [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate
@ 2016-06-15 17:15 ` Xin Long
  0 siblings, 0 replies; 10+ messages in thread
From: Xin Long @ 2016-06-15 17:15 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: Marcelo Ricardo Leitner, Vlad Yasevich, daniel, xiaolong.ye,
	davem, eric.dumazet

Commit d46e416c11c8 ("sctp: sctp should change socket state when
shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
but inet_accept doesn't allow the sk_state other than ESTABLISHED/
CLOSED for sctp. So we will change sk_state to CLOSED, instead of
CLOSING, as actually sk is closed already there.

Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received")
Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 6cae4c6..cdabbd8 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -7568,7 +7568,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
 	 * is called, set RCV_SHUTDOWN flag.
 	 */
 	if (sctp_state(assoc, CLOSED) && sctp_style(newsk, TCP)) {
-		newsk->sk_state = SCTP_SS_CLOSING;
+		newsk->sk_state = SCTP_SS_CLOSED;
 		newsk->sk_shutdown |= RCV_SHUTDOWN;
 	} else {
 		newsk->sk_state = SCTP_SS_ESTABLISHED;
-- 
2.1.0


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

* Re: [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate
  2016-06-15 17:15 ` Xin Long
@ 2016-06-15 19:20   ` Sergei Shtylyov
  -1 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2016-06-15 19:20 UTC (permalink / raw)
  To: Xin Long, network dev, linux-sctp
  Cc: Marcelo Ricardo Leitner, Vlad Yasevich, daniel, xiaolong.ye,
	davem, eric.dumazet

Hello.

On 06/15/2016 08:15 PM, Xin Long wrote:

> Commit d46e416c11c8 ("sctp: sctp should change socket state when
> shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
> but inet_accept doesn't allow the sk_state other than ESTABLISHED/
> CLOSED for sctp. So we will change sk_state to CLOSED, instead of
> CLOSING, as actually sk is closed already there.
>
> Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received")

    "Commit" not needed here, this tag has well defined form.

> Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
[...]

MBR, Sergei

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

* Re: [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate
@ 2016-06-15 19:20   ` Sergei Shtylyov
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2016-06-15 19:20 UTC (permalink / raw)
  To: Xin Long, network dev, linux-sctp
  Cc: Marcelo Ricardo Leitner, Vlad Yasevich, daniel, xiaolong.ye,
	davem, eric.dumazet

Hello.

On 06/15/2016 08:15 PM, Xin Long wrote:

> Commit d46e416c11c8 ("sctp: sctp should change socket state when
> shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
> but inet_accept doesn't allow the sk_state other than ESTABLISHED/
> CLOSED for sctp. So we will change sk_state to CLOSED, instead of
> CLOSING, as actually sk is closed already there.
>
> Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received")

    "Commit" not needed here, this tag has well defined form.

> Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
[...]

MBR, Sergei


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

* Re: [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate
  2016-06-15 17:15 ` Xin Long
@ 2016-06-16 21:11   ` David Miller
  -1 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2016-06-16 21:11 UTC (permalink / raw)
  To: lucien.xin
  Cc: netdev, linux-sctp, marcelo.leitner, vyasevich, daniel,
	xiaolong.ye, eric.dumazet

From: Xin Long <lucien.xin@gmail.com>
Date: Thu, 16 Jun 2016 01:15:06 +0800

> Commit d46e416c11c8 ("sctp: sctp should change socket state when
> shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
> but inet_accept doesn't allow the sk_state other than ESTABLISHED/
> CLOSED for sctp. So we will change sk_state to CLOSED, instead of
> CLOSING, as actually sk is closed already there.
> 
> Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received")
> Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied.

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

* Re: [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate
@ 2016-06-16 21:11   ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2016-06-16 21:11 UTC (permalink / raw)
  To: lucien.xin
  Cc: netdev, linux-sctp, marcelo.leitner, vyasevich, daniel,
	xiaolong.ye, eric.dumazet

From: Xin Long <lucien.xin@gmail.com>
Date: Thu, 16 Jun 2016 01:15:06 +0800

> Commit d46e416c11c8 ("sctp: sctp should change socket state when
> shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
> but inet_accept doesn't allow the sk_state other than ESTABLISHED/
> CLOSED for sctp. So we will change sk_state to CLOSED, instead of
> CLOSING, as actually sk is closed already there.
> 
> Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received")
> Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied.

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

* Re: [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate
  2016-06-16 21:11   ` David Miller
@ 2016-06-16 21:13     ` marcelo.leitner
  -1 siblings, 0 replies; 10+ messages in thread
From: marcelo.leitner @ 2016-06-16 21:13 UTC (permalink / raw)
  To: David Miller
  Cc: lucien.xin, netdev, linux-sctp, vyasevich, daniel, xiaolong.ye,
	eric.dumazet

On Thu, Jun 16, 2016 at 02:11:39PM -0700, David Miller wrote:
> From: Xin Long <lucien.xin@gmail.com>
> Date: Thu, 16 Jun 2016 01:15:06 +0800
> 
> > Commit d46e416c11c8 ("sctp: sctp should change socket state when
> > shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
> > but inet_accept doesn't allow the sk_state other than ESTABLISHED/
> > CLOSED for sctp. So we will change sk_state to CLOSED, instead of
> > CLOSING, as actually sk is closed already there.
> > 
> > Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received")
> > Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
> > Signed-off-by: Xin Long <lucien.xin@gmail.com>
> 
> Applied.

I thought Xin was going to post a version with that tag Fixed, but ok.

Patch is good to me, fwiw.

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

* Re: [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate
@ 2016-06-16 21:13     ` marcelo.leitner
  0 siblings, 0 replies; 10+ messages in thread
From: marcelo.leitner @ 2016-06-16 21:13 UTC (permalink / raw)
  To: David Miller
  Cc: lucien.xin, netdev, linux-sctp, vyasevich, daniel, xiaolong.ye,
	eric.dumazet

On Thu, Jun 16, 2016 at 02:11:39PM -0700, David Miller wrote:
> From: Xin Long <lucien.xin@gmail.com>
> Date: Thu, 16 Jun 2016 01:15:06 +0800
> 
> > Commit d46e416c11c8 ("sctp: sctp should change socket state when
> > shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
> > but inet_accept doesn't allow the sk_state other than ESTABLISHED/
> > CLOSED for sctp. So we will change sk_state to CLOSED, instead of
> > CLOSING, as actually sk is closed already there.
> > 
> > Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received")
> > Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
> > Signed-off-by: Xin Long <lucien.xin@gmail.com>
> 
> Applied.

I thought Xin was going to post a version with that tag Fixed, but ok.

Patch is good to me, fwiw.


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

* Re: [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate
  2016-06-16 21:13     ` marcelo.leitner
@ 2016-06-16 21:26       ` David Miller
  -1 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2016-06-16 21:26 UTC (permalink / raw)
  To: marcelo.leitner
  Cc: lucien.xin, netdev, linux-sctp, vyasevich, daniel, xiaolong.ye,
	eric.dumazet

From: marcelo.leitner@gmail.com
Date: Thu, 16 Jun 2016 18:13:22 -0300

> On Thu, Jun 16, 2016 at 02:11:39PM -0700, David Miller wrote:
>> From: Xin Long <lucien.xin@gmail.com>
>> Date: Thu, 16 Jun 2016 01:15:06 +0800
>> 
>> > Commit d46e416c11c8 ("sctp: sctp should change socket state when
>> > shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
>> > but inet_accept doesn't allow the sk_state other than ESTABLISHED/
>> > CLOSED for sctp. So we will change sk_state to CLOSED, instead of
>> > CLOSING, as actually sk is closed already there.
>> > 
>> > Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received")
>> > Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
>> > Signed-off-by: Xin Long <lucien.xin@gmail.com>
>> 
>> Applied.
> 
> I thought Xin was going to post a version with that tag Fixed, but ok.

I fixed the tag.

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

* Re: [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate
@ 2016-06-16 21:26       ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2016-06-16 21:26 UTC (permalink / raw)
  To: marcelo.leitner
  Cc: lucien.xin, netdev, linux-sctp, vyasevich, daniel, xiaolong.ye,
	eric.dumazet

From: marcelo.leitner@gmail.com
Date: Thu, 16 Jun 2016 18:13:22 -0300

> On Thu, Jun 16, 2016 at 02:11:39PM -0700, David Miller wrote:
>> From: Xin Long <lucien.xin@gmail.com>
>> Date: Thu, 16 Jun 2016 01:15:06 +0800
>> 
>> > Commit d46e416c11c8 ("sctp: sctp should change socket state when
>> > shutdown is received") may set sk_state CLOSING in sctp_sock_migrate,
>> > but inet_accept doesn't allow the sk_state other than ESTABLISHED/
>> > CLOSED for sctp. So we will change sk_state to CLOSED, instead of
>> > CLOSING, as actually sk is closed already there.
>> > 
>> > Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received")
>> > Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
>> > Signed-off-by: Xin Long <lucien.xin@gmail.com>
>> 
>> Applied.
> 
> I thought Xin was going to post a version with that tag Fixed, but ok.

I fixed the tag.

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

end of thread, other threads:[~2016-06-16 21:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15 17:15 [PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate Xin Long
2016-06-15 17:15 ` Xin Long
2016-06-15 19:20 ` Sergei Shtylyov
2016-06-15 19:20   ` Sergei Shtylyov
2016-06-16 21:11 ` David Miller
2016-06-16 21:11   ` David Miller
2016-06-16 21:13   ` marcelo.leitner
2016-06-16 21:13     ` marcelo.leitner
2016-06-16 21:26     ` David Miller
2016-06-16 21:26       ` David Miller

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.