File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -2649,6 +2649,10 @@ void tcp_set_state(struct sock *sk, int state)
2649
2649
if (oldstate != TCP_ESTABLISHED )
2650
2650
TCP_INC_STATS (sock_net (sk ), TCP_MIB_CURRESTAB );
2651
2651
break ;
2652
+ case TCP_CLOSE_WAIT :
2653
+ if (oldstate == TCP_SYN_RECV )
2654
+ TCP_INC_STATS (sock_net (sk ), TCP_MIB_CURRESTAB );
2655
+ break ;
2652
2656
2653
2657
case TCP_CLOSE :
2654
2658
if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED )
@@ -2660,7 +2664,7 @@ void tcp_set_state(struct sock *sk, int state)
2660
2664
inet_put_port (sk );
2661
2665
fallthrough ;
2662
2666
default :
2663
- if (oldstate == TCP_ESTABLISHED )
2667
+ if (oldstate == TCP_ESTABLISHED || oldstate == TCP_CLOSE_WAIT )
2664
2668
TCP_DEC_STATS (sock_net (sk ), TCP_MIB_CURRESTAB );
2665
2669
}
2666
2670
Original file line number Diff line number Diff line change @@ -2916,9 +2916,14 @@ void mptcp_set_state(struct sock *sk, int state)
2916
2916
if (oldstate != TCP_ESTABLISHED )
2917
2917
MPTCP_INC_STATS (sock_net (sk ), MPTCP_MIB_CURRESTAB );
2918
2918
break ;
2919
-
2919
+ case TCP_CLOSE_WAIT :
2920
+ /* Unlike TCP, MPTCP sk would not have the TCP_SYN_RECV state:
2921
+ * MPTCP "accepted" sockets will be created later on. So no
2922
+ * transition from TCP_SYN_RECV to TCP_CLOSE_WAIT.
2923
+ */
2924
+ break ;
2920
2925
default :
2921
- if (oldstate == TCP_ESTABLISHED )
2926
+ if (oldstate == TCP_ESTABLISHED || oldstate == TCP_CLOSE_WAIT )
2922
2927
MPTCP_DEC_STATS (sock_net (sk ), MPTCP_MIB_CURRESTAB );
2923
2928
}
2924
2929
You can’t perform that action at this time.
0 commit comments