summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2002-03-08 03:49:59 +0000
committerNiels Provos <provos@cvs.openbsd.org>2002-03-08 03:49:59 +0000
commit9b09c9e18ad5231f2173323c6bcd2f1df26a4f81 (patch)
treea4bcf043e4a4ef0f97c84a071e496a6c55ba1af2 /sys/netinet/tcp_output.c
parentbfd6cab07ebbe219670eb8f3c2903f2290a508c2 (diff)
use timeout(9) to schedule TCP timers. this avoid traversing all
tcp connections during tcp_slowtimo. apdapted from thorpej@netbsd.org
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r--sys/netinet/tcp_output.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 83b71bf0058..625bca510c8 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_output.c,v 1.48 2002/03/01 22:29:29 provos Exp $ */
+/* $OpenBSD: tcp_output.c,v 1.49 2002/03/08 03:49:58 provos Exp $ */
/* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */
/*
@@ -78,6 +78,7 @@
#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
+#include <sys/kernel.h>
#include <net/route.h>
#include <net/if.h>
@@ -249,7 +250,7 @@ tcp_output(tp)
* to send, then transmit; otherwise, investigate further.
*/
idle = (tp->snd_max == tp->snd_una);
- if (idle && tp->t_idle >= tp->t_rxtcur)
+ if (idle && (tcp_now - tp->t_rcvtime) >= tp->t_rxtcur)
/*
* We have been idle for "a while" and no acks are
* expected to clock out any data we send --
@@ -982,8 +983,8 @@ send:
* Time this transmission if not a retransmission and
* not currently timing anything.
*/
- if (tp->t_rtt == 0) {
- tp->t_rtt = 1;
+ if (tp->t_rtttime == 0) {
+ tp->t_rtttime = tcp_now;
tp->t_rtseq = startseq;
tcpstat.tcps_segstimed++;
}