diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2018-05-08 15:10:34 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2018-05-08 15:10:34 +0000 |
commit | e19642eee53caef792151745494f1a652e4a3c49 (patch) | |
tree | b60645d150fff5995f56d2e85a6b111ea2404c44 /sys/netinet/tcp_timer.c | |
parent | 479e52bcb99dcccb1b215dcf654953eaabd4c26c (diff) |
Historically there were slow and fast tcp timeouts. That is why
the delack timer had a different implementation. Use the same
mechanism for all TCP timer.
OK mpi@ visa@
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r-- | sys/netinet/tcp_timer.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index b8ac1ac8087..689ac152c1f 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_timer.c,v 1.64 2018/02/07 00:31:10 bluhm Exp $ */ +/* $OpenBSD: tcp_timer.c,v 1.65 2018/05/08 15:10:33 bluhm Exp $ */ /* $NetBSD: tcp_timer.c,v 1.14 1996/02/13 23:44:09 christos Exp $ */ /* @@ -71,6 +71,7 @@ void tcp_timer_persist(void *); void tcp_timer_keep(void *); void tcp_timer_2msl(void *); void tcp_timer_reaper(void *); +void tcp_timer_delack(void *); const tcp_timer_func_t tcp_timer_funcs[TCPT_NTIMERS] = { tcp_timer_rexmt, @@ -78,6 +79,7 @@ const tcp_timer_func_t tcp_timer_funcs[TCPT_NTIMERS] = { tcp_timer_keep, tcp_timer_2msl, tcp_timer_reaper, + tcp_timer_delack, }; /* @@ -104,7 +106,7 @@ tcp_timer_init(void) * Callout to process delayed ACKs for a TCPCB. */ void -tcp_delack(void *arg) +tcp_timer_delack(void *arg) { struct tcpcb *tp = arg; @@ -114,8 +116,12 @@ tcp_delack(void *arg) * ACK callout. */ NET_LOCK(); - if (tp->t_flags & TF_DEAD) + /* Ignore canceled timeouts or timeouts that have been rescheduled. */ + if (!ISSET((tp)->t_flags, TF_TMR_DELACK) || + timeout_pending(&tp->t_timer[TCPT_DELACK])) goto out; + CLR((tp)->t_flags, TF_TMR_DELACK); + tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); out: |