Skip to content

Commit 0a39989

Browse files
JasonXingdavem330
authored andcommitted
tcp: rstreason: introduce SK_RST_REASON_TCP_KEEPALIVE_TIMEOUT for active reset
Introducing this to show the users the reason of keepalive timeout. Signed-off-by: Jason Xing <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent edefba6 commit 0a39989

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

include/net/rstreason.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
FN(TCP_ABORT_ON_LINGER) \
2222
FN(TCP_ABORT_ON_MEMORY) \
2323
FN(TCP_STATE) \
24+
FN(TCP_KEEPALIVE_TIMEOUT) \
2425
FN(MPTCP_RST_EUNSPEC) \
2526
FN(MPTCP_RST_EMPTCP) \
2627
FN(MPTCP_RST_ERESOURCE) \
@@ -108,6 +109,12 @@ enum sk_rst_reason {
108109
* Please see RFC 9293 for all possible reset conditions
109110
*/
110111
SK_RST_REASON_TCP_STATE,
112+
/**
113+
* @SK_RST_REASON_TCP_KEEPALIVE_TIMEOUT: time to timeout
114+
* When we have already run out of all the chances, which means
115+
* keepalive timeout, we have to reset the connection
116+
*/
117+
SK_RST_REASON_TCP_KEEPALIVE_TIMEOUT,
111118

112119
/* Copy from include/uapi/linux/mptcp.h.
113120
* These reset fields will not be changed since they adhere to

net/ipv4/tcp_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ static void tcp_keepalive_timer (struct timer_list *t)
807807
(user_timeout == 0 &&
808808
icsk->icsk_probes_out >= keepalive_probes(tp))) {
809809
tcp_send_active_reset(sk, GFP_ATOMIC,
810-
SK_RST_REASON_NOT_SPECIFIED);
810+
SK_RST_REASON_TCP_KEEPALIVE_TIMEOUT);
811811
tcp_write_err(sk);
812812
goto out;
813813
}

0 commit comments

Comments
 (0)