mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
tcp: fix ssthresh u16 leftover
It was once upon time so that snd_sthresh was a 16-bit quantity. ...That has not been true for long period of time. I run across some ancient compares which still seem to trust such legacy. Put all that magic into a single place, I hopefully found all of them. Compile tested, though linking of allyesconfig is ridiculous nowadays it seems. Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
036d6a673f
commit
0b6a05c1db
6 changed files with 15 additions and 7 deletions
|
|
@ -2012,7 +2012,7 @@ int tcp_disconnect(struct sock *sk, int flags)
|
|||
tp->snd_cwnd = 2;
|
||||
icsk->icsk_probes_out = 0;
|
||||
tp->packets_out = 0;
|
||||
tp->snd_ssthresh = 0x7fffffff;
|
||||
tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
|
||||
tp->snd_cwnd_cnt = 0;
|
||||
tp->bytes_acked = 0;
|
||||
tcp_set_ca_state(sk, TCP_CA_Open);
|
||||
|
|
|
|||
|
|
@ -761,7 +761,7 @@ void tcp_update_metrics(struct sock *sk)
|
|||
set_dst_metric_rtt(dst, RTAX_RTTVAR, var);
|
||||
}
|
||||
|
||||
if (tp->snd_ssthresh >= 0xFFFF) {
|
||||
if (tcp_in_initial_slowstart(tp)) {
|
||||
/* Slow start still did not finish. */
|
||||
if (dst_metric(dst, RTAX_SSTHRESH) &&
|
||||
!dst_metric_locked(dst, RTAX_SSTHRESH) &&
|
||||
|
|
|
|||
|
|
@ -1808,7 +1808,7 @@ static int tcp_v4_init_sock(struct sock *sk)
|
|||
/* See draft-stevens-tcpca-spec-01 for discussion of the
|
||||
* initialization of these values.
|
||||
*/
|
||||
tp->snd_ssthresh = 0x7fffffff; /* Infinity */
|
||||
tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
|
||||
tp->snd_cwnd_clamp = ~0;
|
||||
tp->mss_cache = 536;
|
||||
|
||||
|
|
@ -2284,7 +2284,7 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i, int *len)
|
|||
jiffies_to_clock_t(icsk->icsk_ack.ato),
|
||||
(icsk->icsk_ack.quick << 1) | icsk->icsk_ack.pingpong,
|
||||
tp->snd_cwnd,
|
||||
tp->snd_ssthresh >= 0xFFFF ? -1 : tp->snd_ssthresh,
|
||||
tcp_in_initial_slowstart(tp) ? -1 : tp->snd_ssthresh,
|
||||
len);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
|
|||
newtp->retrans_out = 0;
|
||||
newtp->sacked_out = 0;
|
||||
newtp->fackets_out = 0;
|
||||
newtp->snd_ssthresh = 0x7fffffff;
|
||||
newtp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
|
||||
|
||||
/* So many TCP implementations out there (incorrectly) count the
|
||||
* initial SYN frame in their delayed-ACK and congestion control
|
||||
|
|
|
|||
Loading…
Reference in a new issue