diff options
author | Nikolay Borisov <kernel@kyup.com> | 2016-02-03 02:46:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-07 14:36:11 -0500 |
commit | 1e579caa18b96f9eb18f4f5416658cd15f37c062 (patch) | |
tree | 7c48df6e8e727a5db5ff50c3e6296ff96915c934 /net/ipv4/tcp.c | |
parent | c402d9beffb6141ab2e4d2ad8be71128803a28ca (diff) |
ipv4: Namespaceify tcp_fin_timeout sysctl knob
Signed-off-by: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index f4db6b04cdb4..014f18e2f7b3 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -282,8 +282,6 @@ | |||
282 | #include <asm/unaligned.h> | 282 | #include <asm/unaligned.h> |
283 | #include <net/busy_poll.h> | 283 | #include <net/busy_poll.h> |
284 | 284 | ||
285 | int sysctl_tcp_fin_timeout __read_mostly = TCP_FIN_TIMEOUT; | ||
286 | |||
287 | int sysctl_tcp_min_tso_segs __read_mostly = 2; | 285 | int sysctl_tcp_min_tso_segs __read_mostly = 2; |
288 | 286 | ||
289 | int sysctl_tcp_autocorking __read_mostly = 1; | 287 | int sysctl_tcp_autocorking __read_mostly = 1; |
@@ -2330,6 +2328,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level, | |||
2330 | { | 2328 | { |
2331 | struct tcp_sock *tp = tcp_sk(sk); | 2329 | struct tcp_sock *tp = tcp_sk(sk); |
2332 | struct inet_connection_sock *icsk = inet_csk(sk); | 2330 | struct inet_connection_sock *icsk = inet_csk(sk); |
2331 | struct net *net = sock_net(sk); | ||
2333 | int val; | 2332 | int val; |
2334 | int err = 0; | 2333 | int err = 0; |
2335 | 2334 | ||
@@ -2526,7 +2525,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level, | |||
2526 | case TCP_LINGER2: | 2525 | case TCP_LINGER2: |
2527 | if (val < 0) | 2526 | if (val < 0) |
2528 | tp->linger2 = -1; | 2527 | tp->linger2 = -1; |
2529 | else if (val > sysctl_tcp_fin_timeout / HZ) | 2528 | else if (val > net->ipv4.sysctl_tcp_fin_timeout / HZ) |
2530 | tp->linger2 = 0; | 2529 | tp->linger2 = 0; |
2531 | else | 2530 | else |
2532 | tp->linger2 = val * HZ; | 2531 | tp->linger2 = val * HZ; |
@@ -2771,7 +2770,7 @@ static int do_tcp_getsockopt(struct sock *sk, int level, | |||
2771 | case TCP_LINGER2: | 2770 | case TCP_LINGER2: |
2772 | val = tp->linger2; | 2771 | val = tp->linger2; |
2773 | if (val >= 0) | 2772 | if (val >= 0) |
2774 | val = (val ? : sysctl_tcp_fin_timeout) / HZ; | 2773 | val = (val ? : net->ipv4.sysctl_tcp_fin_timeout) / HZ; |
2775 | break; | 2774 | break; |
2776 | case TCP_DEFER_ACCEPT: | 2775 | case TCP_DEFER_ACCEPT: |
2777 | val = retrans_to_secs(icsk->icsk_accept_queue.rskq_defer_accept, | 2776 | val = retrans_to_secs(icsk->icsk_accept_queue.rskq_defer_accept, |