diff options
author | Eric Dumazet <edumazet@google.com> | 2017-10-27 10:47:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-28 06:24:38 -0400 |
commit | ceef9ab6be7234f9e49f79769e0da88d1dccfcc7 (patch) | |
tree | f512f5ebf5cc730c61fe70b37d812fd88b16b331 /net/ipv4/tcp_output.c | |
parent | d06a99045837d3f4d5431793c4c390b0daf2a08d (diff) |
tcp: Namespace-ify sysctl_tcp_workaround_signed_windows
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 60df3ab52166..5bbed67c27e9 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -45,11 +45,6 @@ | |||
45 | 45 | ||
46 | #include <trace/events/tcp.h> | 46 | #include <trace/events/tcp.h> |
47 | 47 | ||
48 | /* People can turn this on to work with those rare, broken TCPs that | ||
49 | * interpret the window field as a signed quantity. | ||
50 | */ | ||
51 | int sysctl_tcp_workaround_signed_windows __read_mostly = 0; | ||
52 | |||
53 | /* Default TSQ limit of four TSO segments */ | 48 | /* Default TSQ limit of four TSO segments */ |
54 | int sysctl_tcp_limit_output_bytes __read_mostly = 262144; | 49 | int sysctl_tcp_limit_output_bytes __read_mostly = 262144; |
55 | 50 | ||
@@ -196,7 +191,7 @@ u32 tcp_default_init_rwnd(u32 mss) | |||
196 | * be a multiple of mss if possible. We assume here that mss >= 1. | 191 | * be a multiple of mss if possible. We assume here that mss >= 1. |
197 | * This MUST be enforced by all callers. | 192 | * This MUST be enforced by all callers. |
198 | */ | 193 | */ |
199 | void tcp_select_initial_window(int __space, __u32 mss, | 194 | void tcp_select_initial_window(const struct sock *sk, int __space, __u32 mss, |
200 | __u32 *rcv_wnd, __u32 *window_clamp, | 195 | __u32 *rcv_wnd, __u32 *window_clamp, |
201 | int wscale_ok, __u8 *rcv_wscale, | 196 | int wscale_ok, __u8 *rcv_wscale, |
202 | __u32 init_rcv_wnd) | 197 | __u32 init_rcv_wnd) |
@@ -220,7 +215,7 @@ void tcp_select_initial_window(int __space, __u32 mss, | |||
220 | * which we interpret as a sign the remote TCP is not | 215 | * which we interpret as a sign the remote TCP is not |
221 | * misinterpreting the window field as a signed quantity. | 216 | * misinterpreting the window field as a signed quantity. |
222 | */ | 217 | */ |
223 | if (sysctl_tcp_workaround_signed_windows) | 218 | if (sock_net(sk)->ipv4.sysctl_tcp_workaround_signed_windows) |
224 | (*rcv_wnd) = min(space, MAX_TCP_WINDOW); | 219 | (*rcv_wnd) = min(space, MAX_TCP_WINDOW); |
225 | else | 220 | else |
226 | (*rcv_wnd) = space; | 221 | (*rcv_wnd) = space; |
@@ -280,7 +275,8 @@ static u16 tcp_select_window(struct sock *sk) | |||
280 | /* Make sure we do not exceed the maximum possible | 275 | /* Make sure we do not exceed the maximum possible |
281 | * scaled window. | 276 | * scaled window. |
282 | */ | 277 | */ |
283 | if (!tp->rx_opt.rcv_wscale && sysctl_tcp_workaround_signed_windows) | 278 | if (!tp->rx_opt.rcv_wscale && |
279 | sock_net(sk)->ipv4.sysctl_tcp_workaround_signed_windows) | ||
284 | new_win = min(new_win, MAX_TCP_WINDOW); | 280 | new_win = min(new_win, MAX_TCP_WINDOW); |
285 | else | 281 | else |
286 | new_win = min(new_win, (65535U << tp->rx_opt.rcv_wscale)); | 282 | new_win = min(new_win, (65535U << tp->rx_opt.rcv_wscale)); |
@@ -3349,7 +3345,7 @@ static void tcp_connect_init(struct sock *sk) | |||
3349 | if (rcv_wnd == 0) | 3345 | if (rcv_wnd == 0) |
3350 | rcv_wnd = dst_metric(dst, RTAX_INITRWND); | 3346 | rcv_wnd = dst_metric(dst, RTAX_INITRWND); |
3351 | 3347 | ||
3352 | tcp_select_initial_window(tcp_full_space(sk), | 3348 | tcp_select_initial_window(sk, tcp_full_space(sk), |
3353 | tp->advmss - (tp->rx_opt.ts_recent_stamp ? tp->tcp_header_len - sizeof(struct tcphdr) : 0), | 3349 | tp->advmss - (tp->rx_opt.ts_recent_stamp ? tp->tcp_header_len - sizeof(struct tcphdr) : 0), |
3354 | &tp->rcv_wnd, | 3350 | &tp->rcv_wnd, |
3355 | &tp->window_clamp, | 3351 | &tp->window_clamp, |