Fix a bug in the sack code that was causing data to be retransmitted

with the FIN bit set for all segments, if a FIN has already been sent before.
The fix will allow the FIN bit to be set for only the last segment, in case
it has to be retransmitted.

Fix another bug that would have caused snd_nxt to be pulled by len if
there was an error from ip_output. snd_nxt should not be touched
during sack retransmissions.
This commit is contained in:
jayanth 2004-07-28 02:15:14 +00:00
parent ac2fecdcf2
commit b754d213ab

View File

@ -356,8 +356,13 @@ after_sack_rexmit:
len = tp->t_maxseg;
sendalot = 1;
}
if (off + len < so->so_snd.sb_cc)
flags &= ~TH_FIN;
if (sack_rxmit) {
if (SEQ_LT(p->rxmit + len, tp->snd_una + so->so_snd.sb_cc))
flags &= ~TH_FIN;
} else {
if (SEQ_LT(tp->snd_nxt + len, tp->snd_una + so->so_snd.sb_cc))
flags &= ~TH_FIN;
}
recwin = sbspace(&so->so_rcv);
@ -1088,8 +1093,12 @@ timer:
* No need to check for TH_FIN here because
* the TF_SENTFIN flag handles that case.
*/
if ((flags & TH_SYN) == 0)
tp->snd_nxt -= len;
if ((flags & TH_SYN) == 0) {
if (sack_rxmit)
p->rxmit -= len;
else
tp->snd_nxt -= len;
}
}
out: