summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-12-02 08:49:29 +0000
committerdillon <dillon@FreeBSD.org>2001-12-02 08:49:29 +0000
commitf97547e246f3c4f9f272892fa757d7df8dc90b89 (patch)
tree1e2d69883173d0e4c094c85ef435f3c25dc41de5 /sys/netinet/tcp_input.c
parent0b6f0e4522eeceef1d5e5dc2e920666192f7ec2a (diff)
downloadFreeBSD-src-f97547e246f3c4f9f272892fa757d7df8dc90b89.zip
FreeBSD-src-f97547e246f3c4f9f272892fa757d7df8dc90b89.tar.gz
Fix a bug with transmitter restart after receiving a 0 window. The
receiver was not sending an immediate ack with delayed acks turned on when the input buffer is drained, preventing the transmitter from restarting immediately. Propogate the TCP_NODELAY option to accept()ed sockets. (Helps tbench and is a good idea anyway). Some cleanup. Identify additonal issues in comments. MFC after: 1 day
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 6740ebe..d8ece0b 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -152,10 +152,15 @@ do { \
#endif
/*
- * Indicate whether this ack should be delayed.
+ * Indicate whether this ack should be delayed. We can delay the ack if
+ * - delayed acks are enabled and
+ * - there is no delayed ack timer in progress and
+ * - our last ack wasn't a 0-sized window. We never want to delay
+ * the ack that opens up a 0-sized window.
*/
#define DELAY_ACK(tp) \
- (tcp_delack_enabled && !callout_pending(tp->tt_delack))
+ (tcp_delack_enabled && !callout_pending(tp->tt_delack) && \
+ (tp->t_flags & TF_RXWIN0SENT) == 0)
static int
tcp_reass(tp, th, tlenp, m)
OpenPOWER on IntegriCloud