diff options
author | Nikolay Borisov <kernel@kyup.com> | 2016-02-15 12:11:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-16 20:42:54 -0500 |
commit | fa50d974d104113630d68b7d03233a6686230d0c (patch) | |
tree | 17a12ad65afc3bf5302eba390262728d1b3b74dc /net/ipv4/ip_sockglue.c | |
parent | 6cd21d79419c154a73be6fa31bc1a1f42ffd6815 (diff) |
ipv4: Namespaceify ip_default_ttl sysctl knob
Signed-off-by: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 92808f147ef5..3f1befc4e17b 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -1341,10 +1341,13 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname, val = inet->tos; break; case IP_TTL: + { + struct net *net = sock_net(sk); val = (inet->uc_ttl == -1 ? - sysctl_ip_default_ttl : + net->ipv4.sysctl_ip_default_ttl : inet->uc_ttl); break; + } case IP_HDRINCL: val = inet->hdrincl; break; |