summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_input.c20
-rw-r--r--sys/netinet/tcp_reass.c20
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))
OpenPOWER on IntegriCloud