aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2018-06-01 21:24:27 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2018-06-01 21:24:27 +0000
commitc14f9fe5ef39595ed327cffc050cbc5601f64896 (patch)
tree842978612e46b05fa5cf5074095ee67f66e8f256
parenta19dca2dfd63cb0205c6fac1fc0c4e00e8bea89a (diff)
downloadsrc-c14f9fe5ef39595ed327cffc050cbc5601f64896.tar.gz
src-c14f9fe5ef39595ed327cffc050cbc5601f64896.zip
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.
Notes
Notes: svn path=/head/; revision=334497
-rw-r--r--sys/netinet/tcp_syncache.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index cf5fcd666b11..2fb3f1486c4d 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -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;