Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 2,258 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); | 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; | ||||
▲ Show 20 Lines • Show All 770 Lines • ▼ Show 20 Lines | if ((tlen || (thflags & TH_FIN) || tfo_syn) && | ||||
} | } | ||||
if (tp->t_flags & TF_SACK_PERMIT) { | if (tp->t_flags & TF_SACK_PERMIT) { | ||||
if (((tlen == 0) && (save_tlen > 0) && | if (((tlen == 0) && (save_tlen > 0) && | ||||
(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, | ||||
} else | save_start + save_tlen); | ||||
if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { | } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { | ||||
/* | /* | ||||
* Cleaning sackblks by using zero length | * Cleaning sackblks by using zero length | ||||
* update. | * update. | ||||
*/ | */ | ||||
tcp_update_sack_list(tp, save_start, save_start); | if ((tp->rcv_numsacks >= 1) && | ||||
} else | (tp->sackblks[0].end == save_start)) { | ||||
if ((tlen > 0) && (tlen >= save_tlen)) { | /* 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. */ | /* Update of sackblks. */ | ||||
tcp_update_sack_list(tp, save_start, save_start + save_tlen); | tcp_update_dsack_list(tp, save_start, | ||||
} else | save_start + save_tlen); | ||||
if (tlen > 0) { | } else 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 |