diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2009-09-15 04:30:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-15 04:30:10 -0400 |
commit | 0b6a05c1dbebe8c616e2e5b0f52b7a01fd792911 (patch) | |
tree | 18b5a2d16ac3fa8dd6d4528469725c216aed428c /net/ipv4 | |
parent | 036d6a673fa0a2e2c5b72a3b1d1b86114c1711c0 (diff) |
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 <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/tcp.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index edeea060db44..19a0612b8a20 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2012,7 +2012,7 @@ int tcp_disconnect(struct sock *sk, int flags) | |||
2012 | tp->snd_cwnd = 2; | 2012 | tp->snd_cwnd = 2; |
2013 | icsk->icsk_probes_out = 0; | 2013 | icsk->icsk_probes_out = 0; |
2014 | tp->packets_out = 0; | 2014 | tp->packets_out = 0; |
2015 | tp->snd_ssthresh = 0x7fffffff; | 2015 | tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; |
2016 | tp->snd_cwnd_cnt = 0; | 2016 | tp->snd_cwnd_cnt = 0; |
2017 | tp->bytes_acked = 0; | 2017 | tp->bytes_acked = 0; |
2018 | tcp_set_ca_state(sk, TCP_CA_Open); | 2018 | tcp_set_ca_state(sk, TCP_CA_Open); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index af6d6fa00db1..d86784be7ab3 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -761,7 +761,7 @@ void tcp_update_metrics(struct sock *sk) | |||
761 | set_dst_metric_rtt(dst, RTAX_RTTVAR, var); | 761 | set_dst_metric_rtt(dst, RTAX_RTTVAR, var); |
762 | } | 762 | } |
763 | 763 | ||
764 | if (tp->snd_ssthresh >= 0xFFFF) { | 764 | if (tcp_in_initial_slowstart(tp)) { |
765 | /* Slow start still did not finish. */ | 765 | /* Slow start still did not finish. */ |
766 | if (dst_metric(dst, RTAX_SSTHRESH) && | 766 | if (dst_metric(dst, RTAX_SSTHRESH) && |
767 | !dst_metric_locked(dst, RTAX_SSTHRESH) && | 767 | !dst_metric_locked(dst, RTAX_SSTHRESH) && |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 0543561da999..7cda24b53f61 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1808,7 +1808,7 @@ static int tcp_v4_init_sock(struct sock *sk) | |||
1808 | /* See draft-stevens-tcpca-spec-01 for discussion of the | 1808 | /* See draft-stevens-tcpca-spec-01 for discussion of the |
1809 | * initialization of these values. | 1809 | * initialization of these values. |
1810 | */ | 1810 | */ |
1811 | tp->snd_ssthresh = 0x7fffffff; /* Infinity */ | 1811 | tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; |
1812 | tp->snd_cwnd_clamp = ~0; | 1812 | tp->snd_cwnd_clamp = ~0; |
1813 | tp->mss_cache = 536; | 1813 | tp->mss_cache = 536; |
1814 | 1814 | ||
@@ -2284,7 +2284,7 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i, int *len) | |||
2284 | jiffies_to_clock_t(icsk->icsk_ack.ato), | 2284 | jiffies_to_clock_t(icsk->icsk_ack.ato), |
2285 | (icsk->icsk_ack.quick << 1) | icsk->icsk_ack.pingpong, | 2285 | (icsk->icsk_ack.quick << 1) | icsk->icsk_ack.pingpong, |
2286 | tp->snd_cwnd, | 2286 | tp->snd_cwnd, |
2287 | tp->snd_ssthresh >= 0xFFFF ? -1 : tp->snd_ssthresh, | 2287 | tcp_in_initial_slowstart(tp) ? -1 : tp->snd_ssthresh, |
2288 | len); | 2288 | len); |
2289 | } | 2289 | } |
2290 | 2290 | ||
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index e48c37d74d77..045bcfd3f288 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -410,7 +410,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, | |||
410 | newtp->retrans_out = 0; | 410 | newtp->retrans_out = 0; |
411 | newtp->sacked_out = 0; | 411 | newtp->sacked_out = 0; |
412 | newtp->fackets_out = 0; | 412 | newtp->fackets_out = 0; |
413 | newtp->snd_ssthresh = 0x7fffffff; | 413 | newtp->snd_ssthresh = TCP_INFINITE_SSTHRESH; |
414 | 414 | ||
415 | /* So many TCP implementations out there (incorrectly) count the | 415 | /* So many TCP implementations out there (incorrectly) count the |
416 | * initial SYN frame in their delayed-ACK and congestion control | 416 | * initial SYN frame in their delayed-ACK and congestion control |