Message ID | 20240801145444.22988-6-kerneljasonxing@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | tcp: completely support active reset | expand |
On Thu, Aug 1, 2024 at 4:55 PM Jason Xing <kerneljasonxing@gmail.com> wrote: > > From: Jason Xing <kernelxing@tencent.com> > > When we find keepalive timeout here, we should send an RST to the > other side. > > Signed-off-by: Jason Xing <kernelxing@tencent.com> Note that this changelog does not really match the code. We were sending an RST already. Precise changelogs are needed to avoid extra work by stable teams, that can 'catch' things based on some keywords, not only Fixes: tags. Reviewed-by: Eric Dumazet <edumazet@google.com>
Hello Eric, On Fri, Aug 2, 2024 at 5:35 PM Eric Dumazet <edumazet@google.com> wrote: > > On Thu, Aug 1, 2024 at 4:55 PM Jason Xing <kerneljasonxing@gmail.com> wrote: > > > > From: Jason Xing <kernelxing@tencent.com> > > > > When we find keepalive timeout here, we should send an RST to the > > other side. > > > > Signed-off-by: Jason Xing <kernelxing@tencent.com> > > Note that this changelog does not really match the code. > > We were sending an RST already. > > Precise changelogs are needed to avoid extra work by stable teams, > that can 'catch' things based on some keywords, not only Fixes: tags. Thanks for reminding me. I will revise the changelog. > > Reviewed-by: Eric Dumazet <edumazet@google.com> Thanks!
diff --git a/include/net/rstreason.h b/include/net/rstreason.h index bbf20d0bbde7..9c0c46df0e73 100644 --- a/include/net/rstreason.h +++ b/include/net/rstreason.h @@ -21,6 +21,7 @@ FN(TCP_ABORT_ON_LINGER) \ FN(TCP_ABORT_ON_MEMORY) \ FN(TCP_STATE) \ + FN(TCP_KEEPALIVE_TIMEOUT) \ FN(MPTCP_RST_EUNSPEC) \ FN(MPTCP_RST_EMPTCP) \ FN(MPTCP_RST_ERESOURCE) \ @@ -108,6 +109,12 @@ enum sk_rst_reason { * Please see RFC 9293 for all possible reset conditions */ SK_RST_REASON_TCP_STATE, + /** + * @SK_RST_REASON_TCP_KEEPALIVE_TIMEOUT: time to timeout + * When we have already run out of all the chances, which means + * keepalive timeout, we have to reset the connection + */ + SK_RST_REASON_TCP_KEEPALIVE_TIMEOUT, /* Copy from include/uapi/linux/mptcp.h. * These reset fields will not be changed since they adhere to diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 3910f6d8614e..86169127e4d1 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -807,7 +807,7 @@ static void tcp_keepalive_timer (struct timer_list *t) (user_timeout == 0 && icsk->icsk_probes_out >= keepalive_probes(tp))) { tcp_send_active_reset(sk, GFP_ATOMIC, - SK_RST_REASON_NOT_SPECIFIED); + SK_RST_REASON_TCP_KEEPALIVE_TIMEOUT); tcp_write_err(sk); goto out; }