Limit the retransmission timer for SYN-ACKs by TCPTV_REXMTMAX.

Use the same logic to handle the SYN-ACK retransmission when sent from
the syn cache code as when sent from the main code.

MFC after:	3 days
Sponsored by:	Netflix, Inc.
This commit is contained in:
Michael Tuexen 2018-06-01 21:24:27 +00:00
parent a19dca2dfd
commit c14f9fe5ef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334497

View File

@ -415,8 +415,14 @@ syncache_drop(struct syncache *sc, struct syncache_head *sch)
static void
syncache_timeout(struct syncache *sc, struct syncache_head *sch, int docallout)
{
sc->sc_rxttime = ticks +
TCPTV_RTOBASE * (tcp_syn_backoff[sc->sc_rxmits]);
int rexmt;
if (sc->sc_rxmits == 0)
rexmt = TCPTV_RTOBASE;
else
TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_syn_backoff[sc->sc_rxmits],
tcp_rexmit_min, TCPTV_REXMTMAX);
sc->sc_rxttime = ticks + rexmt;
sc->sc_rxmits++;
if (TSTMP_LT(sc->sc_rxttime, sch->sch_nextc)) {
sch->sch_nextc = sc->sc_rxttime;