From b7de7d87a0d9d74a4d511065677ae356b16c8e14 Mon Sep 17 00:00:00 2001 From: Andre Oppermann Date: Sat, 9 Jun 2007 19:39:14 +0000 Subject: [PATCH] Don't send pure window updates when the peer has closed the connection and won't ever send more data. --- sys/netinet/tcp_output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index acd99d00c440..d8adff357b93 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -528,8 +528,11 @@ tcp_output(struct tcpcb *tp) * max size segments, or at least 50% of the maximum possible * window, then want to send a window update to peer. * Skip this if the connection is in T/TCP half-open state. + * Don't send pure window updates when the peer has closed + * the connection and won't ever send more data. */ - if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN)) { + if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) && + !TCPS_HAVERCVDFIN(tp->t_state)) { /* * "adv" is the amount we can increase the window, * taking into account that we are limited by