Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_output.c
Show First 20 Lines • Show All 1,231 Lines • ▼ Show 20 Lines | #endif | ||||
/* | /* | ||||
* According to RFC1323 the window field in a SYN (i.e., a <SYN> | * According to RFC1323 the window field in a SYN (i.e., a <SYN> | ||||
* or <SYN,ACK>) segment itself is never scaled. The <SYN,ACK> | * or <SYN,ACK>) segment itself is never scaled. The <SYN,ACK> | ||||
* case is handled in syncache. | * case is handled in syncache. | ||||
*/ | */ | ||||
if (flags & TH_SYN) | if (flags & TH_SYN) | ||||
th->th_win = htons((u_short) | th->th_win = htons((u_short) | ||||
(min(sbspace(&so->so_rcv), TCP_MAXWIN))); | (min(sbspace(&so->so_rcv), TCP_MAXWIN))); | ||||
else | else { | ||||
recwin = roundup2(recwin, 1 << tp->rcv_scale); | |||||
th->th_win = htons((u_short)(recwin >> tp->rcv_scale)); | th->th_win = htons((u_short)(recwin >> tp->rcv_scale)); | ||||
} | |||||
tuexen: Conceptually it would be `th->th_win == htons(0)`, since the filed is in network byte order. | |||||
Done Inline Actionsreworked the patch, to address a wider range of issues associated with window scaling granularity effects. rscheff: reworked the patch, to address a wider range of issues associated with window scaling… | |||||
/* | /* | ||||
* Adjust the RXWIN0SENT flag - indicate that we have advertised | * Adjust the RXWIN0SENT flag - indicate that we have advertised | ||||
* a 0 window. This may cause the remote transmitter to stall. This | * a 0 window. This may cause the remote transmitter to stall. This | ||||
* flag tells soreceive() to disable delayed acknowledgements when | * flag tells soreceive() to disable delayed acknowledgements when | ||||
* draining the buffer. This can occur if the receiver is attempting | * draining the buffer. This can occur if the receiver is attempting | ||||
* to read more data than can be buffered prior to transmitting on | * to read more data than can be buffered prior to transmitting on | ||||
* the connection. | * the connection. | ||||
▲ Show 20 Lines • Show All 855 Lines • Show Last 20 Lines |
Conceptually it would be th->th_win == htons(0), since the filed is in network byte order.