tcp: improve KASSERT in limited retransmit

When doing a limited retransmit, allow up to 2 * MSS - 1 if the
Nagle algorithm has been disabled.

PR:			282605
Reviewed by:		cc, Peter Lei
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D49922
This commit is contained in:
Michael Tuexen
2025-05-01 18:11:03 +02:00
parent a592b5fd9d
commit 934caaec3a
+5 -3
View File
@@ -2815,9 +2815,11 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th,
KASSERT((tp->t_dupacks == 2 &&
tp->snd_limited == 0) ||
(sent == maxseg + 1 &&
tp->t_flags & TF_SENTFIN),
("%s: sent too much",
__func__));
tp->t_flags & TF_SENTFIN) ||
(sent < 2 * maxseg &&
tp->t_flags & TF_NODELAY),
("%s: sent too much: %u>%u",
__func__, sent, maxseg));
tp->snd_limited = 2;
} else if (sent > 0) {
++tp->snd_limited;