summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/tcp_input.c6
-rw-r--r--sys/netinet/tcp_reass.c6
-rw-r--r--sys/netinet/tcp_subr.c3
-rw-r--r--sys/netinet/tcp_timewait.c3
4 files changed, 10 insertions, 8 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 93cf272..f5aa012 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1147,7 +1147,8 @@ after_listen:
((!tcp_do_newreno && !tp->sack_enable &&
tp->t_dupacks < tcprexmtthresh) ||
((tcp_do_newreno || tp->sack_enable) &&
- !IN_FASTRECOVERY(tp) && to.to_nsacks == 0))) {
+ !IN_FASTRECOVERY(tp) && to.to_nsacks == 0 &&
+ TAILQ_EMPTY(&tp->snd_holes)))) {
KASSERT(headlocked, ("headlocked"));
INP_INFO_WUNLOCK(&tcbinfo);
headlocked = 0;
@@ -1822,7 +1823,8 @@ trimthenstep6:
tcpstat.tcps_rcvacktoomuch++;
goto dropafterack;
}
- if (tp->sack_enable)
+ if (tp->sack_enable &&
+ (to.to_nsacks > 0 || !TAILQ_EMPTY(&tp->snd_holes)))
tcp_sack_doack(tp, &to, th->th_ack);
if (SEQ_LEQ(th->th_ack, tp->snd_una)) {
if (tlen == 0 && tiwin == tp->snd_wnd) {
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index 93cf272..f5aa012 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -1147,7 +1147,8 @@ after_listen:
((!tcp_do_newreno && !tp->sack_enable &&
tp->t_dupacks < tcprexmtthresh) ||
((tcp_do_newreno || tp->sack_enable) &&
- !IN_FASTRECOVERY(tp) && to.to_nsacks == 0))) {
+ !IN_FASTRECOVERY(tp) && to.to_nsacks == 0 &&
+ TAILQ_EMPTY(&tp->snd_holes)))) {
KASSERT(headlocked, ("headlocked"));
INP_INFO_WUNLOCK(&tcbinfo);
headlocked = 0;
@@ -1822,7 +1823,8 @@ trimthenstep6:
tcpstat.tcps_rcvacktoomuch++;
goto dropafterack;
}
- if (tp->sack_enable)
+ if (tp->sack_enable &&
+ (to.to_nsacks > 0 || !TAILQ_EMPTY(&tp->snd_holes)))
tcp_sack_doack(tp, &to, th->th_ack);
if (SEQ_LEQ(th->th_ack, tp->snd_una)) {
if (tlen == 0 && tiwin == tp->snd_wnd) {
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 3adc16e..8376b07 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -605,8 +605,7 @@ tcp_newtcpcb(inp)
if (tcp_do_rfc1323)
tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP);
tp->sack_enable = tcp_do_sack;
- if (tp->sack_enable)
- TAILQ_INIT(&tp->snd_holes);
+ TAILQ_INIT(&tp->snd_holes);
tp->t_inpcb = inp; /* XXX */
/*
* Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 3adc16e..8376b07 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -605,8 +605,7 @@ tcp_newtcpcb(inp)
if (tcp_do_rfc1323)
tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP);
tp->sack_enable = tcp_do_sack;
- if (tp->sack_enable)
- TAILQ_INIT(&tp->snd_holes);
+ TAILQ_INIT(&tp->snd_holes);
tp->t_inpcb = inp; /* XXX */
/*
* Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no
OpenPOWER on IntegriCloud