Skip to content

Commit

Permalink
tcp: rstreason: fully support in tcp_rcv_state_process()
Browse files Browse the repository at this point in the history
Like the previous patch does in this series, finish the conversion map is
enough to let rstreason mechanism work in this function.

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 459a2b3 commit f6d5e2c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions include/net/rstreason.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
FN(TCP_RFC7323_PAWS) \
FN(TCP_TOO_OLD_ACK) \
FN(TCP_ACK_UNSENT_DATA) \
FN(TCP_FLAGS) \
FN(TCP_OLD_ACK) \
FN(TCP_ABORT_ON_DATA) \
FN(MPTCP_RST_EUNSPEC) \
FN(MPTCP_RST_EMPTCP) \
FN(MPTCP_RST_ERESOURCE) \
Expand Down Expand Up @@ -59,6 +62,15 @@ enum sk_rst_reason {
* sent yet
*/
SK_RST_REASON_TCP_ACK_UNSENT_DATA,
/** @SK_RST_REASON_TCP_FLAGS: TCP flags invalid */
SK_RST_REASON_TCP_FLAGS,
/** @SK_RST_REASON_TCP_OLD_ACK: TCP ACK is old, but in window */
SK_RST_REASON_TCP_OLD_ACK,
/**
* @SK_RST_REASON_TCP_ABORT_ON_DATA: abort on data
* corresponding to LINUX_MIB_TCPABORTONDATA
*/
SK_RST_REASON_TCP_ABORT_ON_DATA,

/* Copy from include/uapi/linux/mptcp.h.
* These reset fields will not be changed since they adhere to
Expand Down Expand Up @@ -143,6 +155,12 @@ sk_rst_convert_drop_reason(enum skb_drop_reason reason)
return SK_RST_REASON_TCP_TOO_OLD_ACK;
case SKB_DROP_REASON_TCP_ACK_UNSENT_DATA:
return SK_RST_REASON_TCP_ACK_UNSENT_DATA;
case SKB_DROP_REASON_TCP_FLAGS:
return SK_RST_REASON_TCP_FLAGS;
case SKB_DROP_REASON_TCP_OLD_ACK:
return SK_RST_REASON_TCP_OLD_ACK;
case SKB_DROP_REASON_TCP_ABORT_ON_DATA:
return SK_RST_REASON_TCP_ABORT_ON_DATA;
default:
/* If we don't have our own corresponding reason */
return SK_RST_REASON_NOT_SPECIFIED;
Expand Down

0 comments on commit f6d5e2c

Please sign in to comment.