Fix the SACK block generation in the base TCP stack by bringing it in
sync with the RACK stack. Reviewed by: rrs@ MFC after: 5 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21513
This commit is contained in:
parent
f97bf60469
commit
ecc5b1d156
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351801
@ -2264,7 +2264,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
|
||||
* DSACK - add SACK block for dropped range
|
||||
*/
|
||||
if (tp->t_flags & TF_SACK_PERMIT) {
|
||||
tcp_update_sack_list(tp, th->th_seq, th->th_seq+tlen);
|
||||
tcp_update_sack_list(tp, th->th_seq,
|
||||
th->th_seq + todrop);
|
||||
/*
|
||||
* ACK now, as the next in-sequence segment
|
||||
* will clear the DSACK block again
|
||||
@ -3051,21 +3052,29 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
|
||||
* DSACK actually handled in the fastpath
|
||||
* above.
|
||||
*/
|
||||
tcp_update_sack_list(tp, save_start, save_start + save_tlen);
|
||||
} else
|
||||
if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) {
|
||||
tcp_update_sack_list(tp, save_start,
|
||||
save_start + save_tlen);
|
||||
} else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) {
|
||||
/*
|
||||
* Cleaning sackblks by using zero length
|
||||
* update.
|
||||
*/
|
||||
tcp_update_sack_list(tp, save_start, save_start);
|
||||
} else
|
||||
if ((tlen > 0) && (tlen >= save_tlen)) {
|
||||
if ((tp->rcv_numsacks >= 1) &&
|
||||
(tp->sackblks[0].end == save_start)) {
|
||||
/* partial overlap, recorded at todrop above */
|
||||
tcp_update_sack_list(tp, tp->sackblks[0].start,
|
||||
tp->sackblks[0].end);
|
||||
} else {
|
||||
tcp_update_dsack_list(tp, save_start,
|
||||
save_start + save_tlen);
|
||||
}
|
||||
} else if ((tlen > 0) && (tlen >= save_tlen)) {
|
||||
/* Update of sackblks. */
|
||||
tcp_update_sack_list(tp, save_start, save_start + save_tlen);
|
||||
} else
|
||||
if (tlen > 0) {
|
||||
tcp_update_sack_list(tp, save_start, save_start+tlen);
|
||||
tcp_update_dsack_list(tp, save_start,
|
||||
save_start + save_tlen);
|
||||
} else if (tlen > 0) {
|
||||
tcp_update_dsack_list(tp, save_start,
|
||||
save_start + tlen);
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user