diff options
| -rw-r--r-- | include/net/netns/ipv4.h | 1 | ||||
| -rw-r--r-- | include/net/tcp.h | 1 | ||||
| -rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 14 | ||||
| -rw-r--r-- | net/ipv4/tcp_ipv4.c | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index f0cf5a1b777e..0378e88f6fd3 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
| @@ -110,6 +110,7 @@ struct netns_ipv4 { | |||
| 110 | int sysctl_tcp_orphan_retries; | 110 | int sysctl_tcp_orphan_retries; |
| 111 | int sysctl_tcp_fin_timeout; | 111 | int sysctl_tcp_fin_timeout; |
| 112 | unsigned int sysctl_tcp_notsent_lowat; | 112 | unsigned int sysctl_tcp_notsent_lowat; |
| 113 | int sysctl_tcp_tw_reuse; | ||
| 113 | 114 | ||
| 114 | int sysctl_igmp_max_memberships; | 115 | int sysctl_igmp_max_memberships; |
| 115 | int sysctl_igmp_max_msf; | 116 | int sysctl_igmp_max_msf; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 207147b4c6b2..6061963cca98 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -252,7 +252,6 @@ extern int sysctl_tcp_wmem[3]; | |||
| 252 | extern int sysctl_tcp_rmem[3]; | 252 | extern int sysctl_tcp_rmem[3]; |
| 253 | extern int sysctl_tcp_app_win; | 253 | extern int sysctl_tcp_app_win; |
| 254 | extern int sysctl_tcp_adv_win_scale; | 254 | extern int sysctl_tcp_adv_win_scale; |
| 255 | extern int sysctl_tcp_tw_reuse; | ||
| 256 | extern int sysctl_tcp_frto; | 255 | extern int sysctl_tcp_frto; |
| 257 | extern int sysctl_tcp_low_latency; | 256 | extern int sysctl_tcp_low_latency; |
| 258 | extern int sysctl_tcp_nometrics_save; | 257 | extern int sysctl_tcp_nometrics_save; |
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 80bc36b25de2..22cbd61079b5 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
| @@ -433,13 +433,6 @@ static struct ctl_table ipv4_table[] = { | |||
| 433 | .extra2 = &tcp_adv_win_scale_max, | 433 | .extra2 = &tcp_adv_win_scale_max, |
| 434 | }, | 434 | }, |
| 435 | { | 435 | { |
| 436 | .procname = "tcp_tw_reuse", | ||
| 437 | .data = &sysctl_tcp_tw_reuse, | ||
| 438 | .maxlen = sizeof(int), | ||
| 439 | .mode = 0644, | ||
| 440 | .proc_handler = proc_dointvec | ||
| 441 | }, | ||
| 442 | { | ||
| 443 | .procname = "tcp_frto", | 436 | .procname = "tcp_frto", |
| 444 | .data = &sysctl_tcp_frto, | 437 | .data = &sysctl_tcp_frto, |
| 445 | .maxlen = sizeof(int), | 438 | .maxlen = sizeof(int), |
| @@ -960,6 +953,13 @@ static struct ctl_table ipv4_net_table[] = { | |||
| 960 | .mode = 0644, | 953 | .mode = 0644, |
| 961 | .proc_handler = proc_dointvec, | 954 | .proc_handler = proc_dointvec, |
| 962 | }, | 955 | }, |
| 956 | { | ||
| 957 | .procname = "tcp_tw_reuse", | ||
| 958 | .data = &init_net.ipv4.sysctl_tcp_tw_reuse, | ||
| 959 | .maxlen = sizeof(int), | ||
| 960 | .mode = 0644, | ||
| 961 | .proc_handler = proc_dointvec | ||
| 962 | }, | ||
| 963 | #ifdef CONFIG_IP_ROUTE_MULTIPATH | 963 | #ifdef CONFIG_IP_ROUTE_MULTIPATH |
| 964 | { | 964 | { |
| 965 | .procname = "fib_multipath_use_neigh", | 965 | .procname = "fib_multipath_use_neigh", |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 30d81f533ada..fe9da4fb96bf 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
| @@ -84,7 +84,6 @@ | |||
| 84 | #include <crypto/hash.h> | 84 | #include <crypto/hash.h> |
| 85 | #include <linux/scatterlist.h> | 85 | #include <linux/scatterlist.h> |
| 86 | 86 | ||
| 87 | int sysctl_tcp_tw_reuse __read_mostly; | ||
| 88 | int sysctl_tcp_low_latency __read_mostly; | 87 | int sysctl_tcp_low_latency __read_mostly; |
| 89 | 88 | ||
| 90 | #ifdef CONFIG_TCP_MD5SIG | 89 | #ifdef CONFIG_TCP_MD5SIG |
| @@ -120,7 +119,7 @@ int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | |||
| 120 | and use initial timestamp retrieved from peer table. | 119 | and use initial timestamp retrieved from peer table. |
| 121 | */ | 120 | */ |
| 122 | if (tcptw->tw_ts_recent_stamp && | 121 | if (tcptw->tw_ts_recent_stamp && |
| 123 | (!twp || (sysctl_tcp_tw_reuse && | 122 | (!twp || (sock_net(sk)->ipv4.sysctl_tcp_tw_reuse && |
| 124 | get_seconds() - tcptw->tw_ts_recent_stamp > 1))) { | 123 | get_seconds() - tcptw->tw_ts_recent_stamp > 1))) { |
| 125 | tp->write_seq = tcptw->tw_snd_nxt + 65535 + 2; | 124 | tp->write_seq = tcptw->tw_snd_nxt + 65535 + 2; |
| 126 | if (tp->write_seq == 0) | 125 | if (tp->write_seq == 0) |
| @@ -2456,6 +2455,7 @@ static int __net_init tcp_sk_init(struct net *net) | |||
| 2456 | net->ipv4.sysctl_tcp_orphan_retries = 0; | 2455 | net->ipv4.sysctl_tcp_orphan_retries = 0; |
| 2457 | net->ipv4.sysctl_tcp_fin_timeout = TCP_FIN_TIMEOUT; | 2456 | net->ipv4.sysctl_tcp_fin_timeout = TCP_FIN_TIMEOUT; |
| 2458 | net->ipv4.sysctl_tcp_notsent_lowat = UINT_MAX; | 2457 | net->ipv4.sysctl_tcp_notsent_lowat = UINT_MAX; |
| 2458 | net->ipv4.sysctl_tcp_tw_reuse = 0; | ||
| 2459 | 2459 | ||
| 2460 | return 0; | 2460 | return 0; |
| 2461 | fail: | 2461 | fail: |
