Fix for a bug in the change that defers sack option processing until

after PAWS checks. The symptom of this is an inconsistency in the cached
sack state, caused by the fact that the sack scoreboard was not being
updated for an ACK handled in the header prediction path.

Found by:	Andrey Chernov.
Submitted by:	Noritoshi Demizu, Raja Mukerji.
Approved by:	re
This commit is contained in:
Paul Saab 2005-07-01 22:54:18 +00:00
parent 69e0362019
commit 482ac96888
4 changed files with 10 additions and 8 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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

View File

@ -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