Skip to content

Commit 2b9669d

Browse files
JasonXingkuba-moo
authored andcommitted
tcp: rstreason: fully support in tcp_rcv_synsent_state_process()
In this function, only updating the map can finish the job for socket reset reason because the corresponding drop reasons are ready. Signed-off-by: Jason Xing <kernelxing@tencent.com> Link: https://lore.kernel.org/r/20240510122502.27850-2-kerneljasonxing@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0621be4 commit 2b9669d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

include/net/rstreason.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#define DEFINE_RST_REASON(FN, FNe) \
99
FN(NOT_SPECIFIED) \
1010
FN(NO_SOCKET) \
11+
FN(TCP_INVALID_ACK_SEQUENCE) \
12+
FN(TCP_RFC7323_PAWS) \
1113
FN(MPTCP_RST_EUNSPEC) \
1214
FN(MPTCP_RST_EMPTCP) \
1315
FN(MPTCP_RST_ERESOURCE) \
@@ -37,6 +39,17 @@ enum sk_rst_reason {
3739
SK_RST_REASON_NOT_SPECIFIED,
3840
/** @SK_RST_REASON_NO_SOCKET: no valid socket that can be used */
3941
SK_RST_REASON_NO_SOCKET,
42+
/**
43+
* @SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE: Not acceptable ACK SEQ
44+
* field because ack sequence is not in the window between snd_una
45+
* and snd_nxt
46+
*/
47+
SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE,
48+
/**
49+
* @SK_RST_REASON_TCP_RFC7323_PAWS: PAWS check, corresponding to
50+
* LINUX_MIB_PAWSESTABREJECTED, LINUX_MIB_PAWSACTIVEREJECTED
51+
*/
52+
SK_RST_REASON_TCP_RFC7323_PAWS,
4053

4154
/* Copy from include/uapi/linux/mptcp.h.
4255
* These reset fields will not be changed since they adhere to
@@ -113,6 +126,10 @@ sk_rst_convert_drop_reason(enum skb_drop_reason reason)
113126
return SK_RST_REASON_NOT_SPECIFIED;
114127
case SKB_DROP_REASON_NO_SOCKET:
115128
return SK_RST_REASON_NO_SOCKET;
129+
case SKB_DROP_REASON_TCP_INVALID_ACK_SEQUENCE:
130+
return SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE;
131+
case SKB_DROP_REASON_TCP_RFC7323_PAWS:
132+
return SK_RST_REASON_TCP_RFC7323_PAWS;
116133
default:
117134
/* If we don't have our own corresponding reason */
118135
return SK_RST_REASON_NOT_SPECIFIED;

0 commit comments

Comments
 (0)