mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
tcp: rstreason: handle timewait cases in the receive path
There are two possible cases where TCP layer can send an RST. Since they happen in the same place, I think using one independent reason is enough to identify this special situation. Signed-off-by: Jason Xing <kernelxing@tencent.com> Link: https://lore.kernel.org/r/20240510122502.27850-5-kerneljasonxing@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
f6d5e2cc29
commit
22a3255775
@ -15,6 +15,7 @@
|
||||
FN(TCP_FLAGS) \
|
||||
FN(TCP_OLD_ACK) \
|
||||
FN(TCP_ABORT_ON_DATA) \
|
||||
FN(TCP_TIMEWAIT_SOCKET) \
|
||||
FN(MPTCP_RST_EUNSPEC) \
|
||||
FN(MPTCP_RST_EMPTCP) \
|
||||
FN(MPTCP_RST_ERESOURCE) \
|
||||
@ -72,6 +73,10 @@ enum sk_rst_reason {
|
||||
*/
|
||||
SK_RST_REASON_TCP_ABORT_ON_DATA,
|
||||
|
||||
/* Here start with the independent reasons */
|
||||
/** @SK_RST_REASON_TCP_TIMEWAIT_SOCKET: happen on the timewait socket */
|
||||
SK_RST_REASON_TCP_TIMEWAIT_SOCKET,
|
||||
|
||||
/* Copy from include/uapi/linux/mptcp.h.
|
||||
* These reset fields will not be changed since they adhere to
|
||||
* RFC 8684. So do not touch them. I'm going to list each definition
|
||||
|
@ -2427,7 +2427,7 @@ do_time_wait:
|
||||
tcp_v4_timewait_ack(sk, skb);
|
||||
break;
|
||||
case TCP_TW_RST:
|
||||
tcp_v4_send_reset(sk, skb, sk_rst_convert_drop_reason(drop_reason));
|
||||
tcp_v4_send_reset(sk, skb, SK_RST_REASON_TCP_TIMEWAIT_SOCKET);
|
||||
inet_twsk_deschedule_put(inet_twsk(sk));
|
||||
goto discard_it;
|
||||
case TCP_TW_SUCCESS:;
|
||||
|
@ -1999,7 +1999,7 @@ do_time_wait:
|
||||
tcp_v6_timewait_ack(sk, skb);
|
||||
break;
|
||||
case TCP_TW_RST:
|
||||
tcp_v6_send_reset(sk, skb, sk_rst_convert_drop_reason(drop_reason));
|
||||
tcp_v6_send_reset(sk, skb, SK_RST_REASON_TCP_TIMEWAIT_SOCKET);
|
||||
inet_twsk_deschedule_put(inet_twsk(sk));
|
||||
goto discard_it;
|
||||
case TCP_TW_SUCCESS:
|
||||
|
Loading…
Reference in New Issue
Block a user