summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_timer.c
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-02-26 21:33:55 +0000
committerjlemon <jlemon@FreeBSD.org>2001-02-26 21:33:55 +0000
commit825b685ed9a5971ca52d4f4524a383e84b332e73 (patch)
tree45b478a07834cf8419a77466fa0474f1ee3ca3a1 /sys/netinet/tcp_timer.c
parent8260da124e28847c02e67eab46bceb9d967f5c75 (diff)
downloadFreeBSD-src-825b685ed9a5971ca52d4f4524a383e84b332e73.zip
FreeBSD-src-825b685ed9a5971ca52d4f4524a383e84b332e73.tar.gz
Use more aggressive retransmit timeouts for the initial SYN packet.
As we currently drop the connection after 4 retransmits + 2 ICMP errors, this allows initial connection attempts to be dropped much faster.
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r--sys/netinet/tcp_timer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 18686aa..0947295 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -153,6 +153,9 @@ tcp_canceltimers(tp)
callout_stop(tp->tt_rexmt);
}
+int tcp_syn_backoff[TCP_MAXRXTSHIFT + 1] =
+ { 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 64, 64 };
+
int tcp_backoff[TCP_MAXRXTSHIFT + 1] =
{ 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 };
@@ -393,7 +396,10 @@ tcp_timer_rexmt(xtp)
tp->t_badrxtwin = ticks + (tp->t_srtt >> (TCP_RTT_SHIFT + 1));
}
tcpstat.tcps_rexmttimeo++;
- rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
+ if (tp->t_state == TCPS_SYN_SENT)
+ rexmt = TCP_REXMTVAL(tp) * tcp_syn_backoff[tp->t_rxtshift];
+ else
+ rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
TCPT_RANGESET(tp->t_rxtcur, rexmt,
tp->t_rttmin, TCPTV_REXMTMAX);
/*
OpenPOWER on IntegriCloud