From f55740d974a2ef80ddd0accc039bee47b82632ca Mon Sep 17 00:00:00 2001 From: dg Date: Mon, 1 Aug 1994 12:00:25 +0000 Subject: Fixed bug with Nagel Congestion Avoidance where a tcp connection would stall unnecessarily - always send an ACK when a packet len of < mss is received. --- sys/netinet/tcp_input.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'sys/netinet/tcp_input.c') diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 13849d4..121cb94 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -491,7 +491,17 @@ findpcb: m->m_len -= sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr); sbappend(&so->so_rcv, m); sorwakeup(so); - tp->t_flags |= TF_DELACK; + /* + * If this is a small packet, then ACK now - with Nagel + * congestion avoidance sender won't send more until + * he gets an ACK. + */ + if ((unsigned)ti->ti_len < tp->t_maxseg) { + tp->t_flags |= TF_ACKNOW; + tcp_output(tp); + } else { + tp->t_flags |= TF_DELACK; + } return; } } @@ -1264,6 +1274,14 @@ dodata: /* XXX */ tcp_trace(TA_INPUT, ostate, tp, &tcp_saveti, 0); /* + * If this is a small packet, then ACK now - with Nagel + * congestion avoidance sender won't send more until + * he gets an ACK. + */ + if (ti->ti_len && ((unsigned)ti->ti_len < tp->t_maxseg)) + tp->t_flags |= TF_ACKNOW; + + /* * Return any desired output. */ if (needoutput || (tp->t_flags & TF_ACKNOW)) -- cgit v1.1