Skip to content

Commit 459a2b3

Browse files
JasonXingkuba-moo
authored andcommitted
tcp: rstreason: fully support in tcp_ack()
Based on the existing skb drop reason, updating the rstreason map can help us finish the rstreason job in this function. Signed-off-by: Jason Xing <kernelxing@tencent.com> Link: https://lore.kernel.org/r/20240510122502.27850-3-kerneljasonxing@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 2b9669d commit 459a2b3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/net/rstreason.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
FN(NO_SOCKET) \
1111
FN(TCP_INVALID_ACK_SEQUENCE) \
1212
FN(TCP_RFC7323_PAWS) \
13+
FN(TCP_TOO_OLD_ACK) \
14+
FN(TCP_ACK_UNSENT_DATA) \
1315
FN(MPTCP_RST_EUNSPEC) \
1416
FN(MPTCP_RST_EMPTCP) \
1517
FN(MPTCP_RST_ERESOURCE) \
@@ -50,6 +52,13 @@ enum sk_rst_reason {
5052
* LINUX_MIB_PAWSESTABREJECTED, LINUX_MIB_PAWSACTIVEREJECTED
5153
*/
5254
SK_RST_REASON_TCP_RFC7323_PAWS,
55+
/** @SK_RST_REASON_TCP_TOO_OLD_ACK: TCP ACK is too old */
56+
SK_RST_REASON_TCP_TOO_OLD_ACK,
57+
/**
58+
* @SK_RST_REASON_TCP_ACK_UNSENT_DATA: TCP ACK for data we haven't
59+
* sent yet
60+
*/
61+
SK_RST_REASON_TCP_ACK_UNSENT_DATA,
5362

5463
/* Copy from include/uapi/linux/mptcp.h.
5564
* These reset fields will not be changed since they adhere to
@@ -130,6 +139,10 @@ sk_rst_convert_drop_reason(enum skb_drop_reason reason)
130139
return SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE;
131140
case SKB_DROP_REASON_TCP_RFC7323_PAWS:
132141
return SK_RST_REASON_TCP_RFC7323_PAWS;
142+
case SKB_DROP_REASON_TCP_TOO_OLD_ACK:
143+
return SK_RST_REASON_TCP_TOO_OLD_ACK;
144+
case SKB_DROP_REASON_TCP_ACK_UNSENT_DATA:
145+
return SK_RST_REASON_TCP_ACK_UNSENT_DATA;
133146
default:
134147
/* If we don't have our own corresponding reason */
135148
return SK_RST_REASON_NOT_SPECIFIED;

0 commit comments

Comments
 (0)