aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_input.c4
-rw-r--r--sys/netinet/tcp_reass.c4
-rw-r--r--sys/netinet/tcp_subr.c1
-rw-r--r--sys/netinet/tcp_timewait.c1
4 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 6255042a55b6..2ed59ce94acc 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -256,6 +256,7 @@ tcp_reass(tp, th, tlenp, m)
tcp_reass_overflows++;
tcpstat.tcps_rcvmemdrop++;
m_freem(m);
+ *tlenp = 0;
return (0);
}
@@ -267,6 +268,7 @@ tcp_reass(tp, th, tlenp, m)
if (te == NULL) {
tcpstat.tcps_rcvmemdrop++;
m_freem(m);
+ *tlenp = 0;
return (0);
}
tp->t_segqlen++;
@@ -2295,7 +2297,7 @@ dodata: /* XXX */
thflags = tcp_reass(tp, th, &tlen, m);
tp->t_flags |= TF_ACKNOW;
}
- if (tp->sack_enable)
+ if (tlen > 0 && tp->sack_enable)
tcp_update_sack_list(tp, th->th_seq, th->th_seq + tlen);
/*
* Note the amount of data that peer has sent into
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index 6255042a55b6..2ed59ce94acc 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -256,6 +256,7 @@ tcp_reass(tp, th, tlenp, m)
tcp_reass_overflows++;
tcpstat.tcps_rcvmemdrop++;
m_freem(m);
+ *tlenp = 0;
return (0);
}
@@ -267,6 +268,7 @@ tcp_reass(tp, th, tlenp, m)
if (te == NULL) {
tcpstat.tcps_rcvmemdrop++;
m_freem(m);
+ *tlenp = 0;
return (0);
}
tp->t_segqlen++;
@@ -2295,7 +2297,7 @@ dodata: /* XXX */
thflags = tcp_reass(tp, th, &tlen, m);
tp->t_flags |= TF_ACKNOW;
}
- if (tp->sack_enable)
+ if (tlen > 0 && tp->sack_enable)
tcp_update_sack_list(tp, th->th_seq, th->th_seq + tlen);
/*
* Note the amount of data that peer has sent into
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index ed5eab35ad27..3516c746639f 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -806,6 +806,7 @@ tcp_drain()
tcpb->t_segqlen--;
tcp_reass_qsize--;
}
+ tcp_clean_sackreport(tcpb);
}
INP_UNLOCK(inpb);
}
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index ed5eab35ad27..3516c746639f 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -806,6 +806,7 @@ tcp_drain()
tcpb->t_segqlen--;
tcp_reass_qsize--;
}
+ tcp_clean_sackreport(tcpb);
}
INP_UNLOCK(inpb);
}