Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 2,256 Lines • ▼ Show 20 Lines | if (todrop > 0) { | ||||
} else { | } else { | ||||
TCPSTAT_INC(tcps_rcvpartduppack); | TCPSTAT_INC(tcps_rcvpartduppack); | ||||
TCPSTAT_ADD(tcps_rcvpartdupbyte, todrop); | TCPSTAT_ADD(tcps_rcvpartdupbyte, todrop); | ||||
} | } | ||||
/* | /* | ||||
* DSACK - add SACK block for dropped range | * DSACK - add SACK block for dropped range | ||||
*/ | */ | ||||
if (tp->t_flags & TF_SACK_PERMIT) { | if (tp->t_flags & TF_SACK_PERMIT) { | ||||
tcp_update_sack_list(tp, th->th_seq, th->th_seq+tlen); | |||||
/* | /* | ||||
* up here, we only need to store the duplicated range | |||||
* as sackblk[0], for reference below during dsack | |||||
*/ | |||||
tcp_update_sack_list(tp, th->th_seq, th->th_seq+todrop); | |||||
/* | |||||
* ACK now, as the next in-sequence segment | * ACK now, as the next in-sequence segment | ||||
* will clear the DSACK block again | * will clear the DSACK block again | ||||
*/ | */ | ||||
tp->t_flags |= TF_ACKNOW; | tp->t_flags |= TF_ACKNOW; | ||||
} | } | ||||
drop_hdrlen += todrop; /* drop from the top afterwards */ | drop_hdrlen += todrop; /* drop from the top afterwards */ | ||||
th->th_seq += todrop; | th->th_seq += todrop; | ||||
tlen -= todrop; | tlen -= todrop; | ||||
▲ Show 20 Lines • Show All 772 Lines • ▼ Show 20 Lines | if (tp->t_flags & TF_SACK_PERMIT) { | ||||
(SEQ_LT(save_start, save_rnxt)))) { | (SEQ_LT(save_start, save_rnxt)))) { | ||||
/* | /* | ||||
* DSACK actually handled in the fastpath | * DSACK actually handled in the fastpath | ||||
* above. | * above. | ||||
*/ | */ | ||||
tcp_update_sack_list(tp, save_start, save_start + save_tlen); | tcp_update_sack_list(tp, save_start, save_start + save_tlen); | ||||
} else | } else | ||||
if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { | if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { | ||||
/* | if ((tp->rcv_numsacks >= 1) && | ||||
* Cleaning sackblks by using zero length | (tp->sackblks[0].end == save_start)) { | ||||
* update. | /* partial overlap */ | ||||
*/ | tcp_update_sack_list(tp, tp->sackblks[0].start, tp->sackblks[0].end); | ||||
tcp_update_sack_list(tp, save_start, save_start); | } else { | ||||
tcp_update_dsack_list(tp, save_start, save_start + save_tlen); | |||||
} | |||||
} else | } else | ||||
if ((tlen > 0) && (tlen >= save_tlen)) { | if ((tlen > 0) && (tlen >= save_tlen)) { | ||||
/* Update of sackblks. */ | /* Update of sackblks. */ | ||||
tcp_update_sack_list(tp, save_start, save_start + save_tlen); | tcp_update_dsack_list(tp, save_start, save_start + save_tlen); | ||||
} else | } else | ||||
if (tlen > 0) { | if (tlen > 0) { | ||||
tcp_update_sack_list(tp, save_start, save_start+tlen); | tcp_update_dsack_list(tp, save_start, save_start+tlen); | ||||
} | } | ||||
} | } | ||||
#if 0 | #if 0 | ||||
/* | /* | ||||
* Note the amount of data that peer has sent into | * Note the amount of data that peer has sent into | ||||
* our window, in order to estimate the sender's | * our window, in order to estimate the sender's | ||||
* buffer size. | * buffer size. | ||||
* XXX: Unused. | * XXX: Unused. | ||||
▲ Show 20 Lines • Show All 790 Lines • Show Last 20 Lines |