Skip to content

Commit

Permalink
tcp: rstreason: fully support in tcp_rcv_synsent_state_process()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
JasonXing authored and kuba-moo committed May 14, 2024
1 parent 0621be4 commit 2b9669d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions include/net/rstreason.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#define DEFINE_RST_REASON(FN, FNe) \
FN(NOT_SPECIFIED) \
FN(NO_SOCKET) \
FN(TCP_INVALID_ACK_SEQUENCE) \
FN(TCP_RFC7323_PAWS) \
FN(MPTCP_RST_EUNSPEC) \
FN(MPTCP_RST_EMPTCP) \
FN(MPTCP_RST_ERESOURCE) \
Expand Down Expand Up @@ -37,6 +39,17 @@ enum sk_rst_reason {
SK_RST_REASON_NOT_SPECIFIED,
/** @SK_RST_REASON_NO_SOCKET: no valid socket that can be used */
SK_RST_REASON_NO_SOCKET,
/**
* @SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE: Not acceptable ACK SEQ
* field because ack sequence is not in the window between snd_una
* and snd_nxt
*/
SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE,
/**
* @SK_RST_REASON_TCP_RFC7323_PAWS: PAWS check, corresponding to
* LINUX_MIB_PAWSESTABREJECTED, LINUX_MIB_PAWSACTIVEREJECTED
*/
SK_RST_REASON_TCP_RFC7323_PAWS,

/* Copy from include/uapi/linux/mptcp.h.
* These reset fields will not be changed since they adhere to
Expand Down Expand Up @@ -113,6 +126,10 @@ sk_rst_convert_drop_reason(enum skb_drop_reason reason)
return SK_RST_REASON_NOT_SPECIFIED;
case SKB_DROP_REASON_NO_SOCKET:
return SK_RST_REASON_NO_SOCKET;
case SKB_DROP_REASON_TCP_INVALID_ACK_SEQUENCE:
return SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE;
case SKB_DROP_REASON_TCP_RFC7323_PAWS:
return SK_RST_REASON_TCP_RFC7323_PAWS;
default:
/* If we don't have our own corresponding reason */
return SK_RST_REASON_NOT_SPECIFIED;
Expand Down

0 comments on commit 2b9669d

Please sign in to comment.