tcp: exclude KASSERTS when rescue retransmissions are in play.

The KASSERT criteria needs to be checked against the
sendbuffer so_snd in a subsequent version.

Reviewed By:	tuexen, #transport
PR:		263445
MFC after:	1 week
Sponsored by:	NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D35431
This commit is contained in:
Richard Scheffenegger 2022-06-08 14:21:28 +02:00
parent d5d6949031
commit 57317c8971

View File

@ -970,16 +970,18 @@ tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt)
}
}
KASSERT(SEQ_LT(hole->start, hole->end), ("%s: hole.start >= hole.end", __func__));
KASSERT(SEQ_LT(hole->start, tp->snd_fack), ("%s: hole.start >= snd.fack", __func__));
KASSERT(SEQ_LT(hole->end, tp->snd_fack), ("%s: hole.end >= snd.fack", __func__));
KASSERT(SEQ_LT(hole->rxmit, tp->snd_fack), ("%s: hole.rxmit >= snd.fack", __func__));
if (SEQ_GEQ(hole->start, hole->end) ||
SEQ_GEQ(hole->start, tp->snd_fack) ||
SEQ_GEQ(hole->end, tp->snd_fack) ||
SEQ_GEQ(hole->rxmit, tp->snd_fack)) {
log(LOG_CRIT,"tcp: invalid SACK hole (%u-%u,%u) vs fwd ack %u, ignoring.\n",
hole->start, hole->end, hole->rxmit, tp->snd_fack);
return (NULL);
if (!(V_tcp_do_newsack)) {
KASSERT(SEQ_LT(hole->start, tp->snd_fack), ("%s: hole.start >= snd.fack", __func__));
KASSERT(SEQ_LT(hole->end, tp->snd_fack), ("%s: hole.end >= snd.fack", __func__));
KASSERT(SEQ_LT(hole->rxmit, tp->snd_fack), ("%s: hole.rxmit >= snd.fack", __func__));
if (SEQ_GEQ(hole->start, hole->end) ||
SEQ_GEQ(hole->start, tp->snd_fack) ||
SEQ_GEQ(hole->end, tp->snd_fack) ||
SEQ_GEQ(hole->rxmit, tp->snd_fack)) {
log(LOG_CRIT,"tcp: invalid SACK hole (%u-%u,%u) vs fwd ack %u, ignoring.\n",
hole->start, hole->end, hole->rxmit, tp->snd_fack);
return (NULL);
}
}
return (hole);
}