aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorRichard Scheffenegger <rscheff@FreeBSD.org>2023-01-26 17:07:11 +0000
committerRichard Scheffenegger <rscheff@FreeBSD.org>2023-01-26 17:08:00 +0000
commit18b83b626a4f596f1686140b99473125be9e33bf (patch)
tree5a675183207121713918a9526e513e98ca59b99f /sys/netinet/tcp_input.c
parent7a78ae88659e0f6a901574d17672d1ccdc3e971b (diff)
downloadsrc-18b83b626a4f596f1686140b99473125be9e33bf.tar.gz
src-18b83b626a4f596f1686140b99473125be9e33bf.zip
tcp: reduce the size of t_rttupdated in tcpcb
During tcp session start, various mechanisms need to track a few initial RTTs before becoming active. Prevent overflows of the corresponding tracking counter and reduce the size of tcpcb simultaneously. Reviewed By: #transport, tuexen, guest-ccui Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D21117
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 606f6649d73d..72faf53299e4 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -3537,7 +3537,8 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt)
INP_WLOCK_ASSERT(tptoinpcb(tp));
TCPSTAT_INC(tcps_rttupdated);
- tp->t_rttupdated++;
+ if (tp->t_rttupdated < UCHAR_MAX)
+ tp->t_rttupdated++;
#ifdef STATS
stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RTT,
imax(0, rtt * 1000 / hz));