diff options
author | Jonathan Lemon <jlemon@FreeBSD.org> | 2001-02-25 15:17:24 +0000 |
---|---|---|
committer | Jonathan Lemon <jlemon@FreeBSD.org> | 2001-02-25 15:17:24 +0000 |
commit | d8c85a260f87f165a193e2e4e88f32e25a4007f2 (patch) | |
tree | 9046188613e243c1324a4ccb42ae1e598eeccb93 /sys/netinet/tcp_input.c | |
parent | b94193dfc1b82254a7ec9c3176da3fc7ad9fa4d7 (diff) | |
download | src-test2-d8c85a260f87f165a193e2e4e88f32e25a4007f2.tar.gz src-test2-d8c85a260f87f165a193e2e4e88f32e25a4007f2.zip |
Notes
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 2c838c68ff73..49cbdee3fe0b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -165,6 +165,12 @@ do { \ #endif /* + * Indicate whether this ack should be delayed. + */ +#define DELAY_ACK(tp) \ + (tcp_delack_enabled && !callout_pending(tp->tt_delack)) + +/* * Insert segment which inludes th into reassembly queue of tcp with * control block tp. Return TH_FIN if reassembly now includes * a segment with FIN. The macro form does the common case inline @@ -178,7 +184,7 @@ do { \ if ((th)->th_seq == (tp)->rcv_nxt && \ LIST_EMPTY(&(tp)->t_segq) && \ (tp)->t_state == TCPS_ESTABLISHED) { \ - if (tcp_delack_enabled) \ + if (DELAY_ACK(tp)) \ callout_reset(tp->tt_delack, tcp_delacktime, \ tcp_timer_delack, tp); \ else \ @@ -968,7 +974,7 @@ findpcb: m_adj(m, drop_hdrlen); /* delayed header drop */ sbappend(&so->so_rcv, m); sorwakeup(so); - if (tcp_delack_enabled) { + if (DELAY_ACK(tp)) { callout_reset(tp->tt_delack, tcp_delacktime, tcp_timer_delack, tp); } else { @@ -1153,7 +1159,7 @@ findpcb: * segment. Otherwise must send ACK now in case * the other side is slow starting. */ - if (tcp_delack_enabled && ((thflags & TH_FIN) || + if (DELAY_ACK(tp) && ((thflags & TH_FIN) || (tlen != 0 && #ifdef INET6 ((isipv6 && in6_localaddr(&inp->in6p_faddr)) @@ -1304,7 +1310,7 @@ findpcb: * If there's data, delay ACK; if there's also a FIN * ACKNOW will be turned on later. */ - if (tcp_delack_enabled && tlen != 0) + if (DELAY_ACK(tp) && tlen != 0) callout_reset(tp->tt_delack, tcp_delacktime, tcp_timer_delack, tp); else @@ -2170,7 +2176,7 @@ dodata: /* XXX */ * Otherwise, since we received a FIN then no * more input can be expected, send ACK now. */ - if (tcp_delack_enabled && (tp->t_flags & TF_NEEDSYN)) + if (DELAY_ACK(tp) && (tp->t_flags & TF_NEEDSYN)) callout_reset(tp->tt_delack, tcp_delacktime, tcp_timer_delack, tp); else |