diff options
author | dg <dg@FreeBSD.org> | 1994-08-01 12:00:25 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-08-01 12:00:25 +0000 |
commit | f55740d974a2ef80ddd0accc039bee47b82632ca (patch) | |
tree | e7c04d144a73a4cd8997c2cf9d3d765791c9205c /sys | |
parent | 8894126bab3322652d3f567305653432b71ed9b3 (diff) | |
download | FreeBSD-src-f55740d974a2ef80ddd0accc039bee47b82632ca.zip FreeBSD-src-f55740d974a2ef80ddd0accc039bee47b82632ca.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/tcp_input.c | 20 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 20 |
2 files changed, 38 insertions, 2 deletions
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)) diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 13849d4..121cb94 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.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)) |