diff options
author | Nikolay Borisov <kernel@kyup.com> | 2016-02-15 05:11:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-16 20:42:54 -0500 |
commit | fa50d974d104113630d68b7d03233a6686230d0c (patch) | |
tree | 17a12ad65afc3bf5302eba390262728d1b3b74dc /include/net | |
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 'include/net')
-rw-r--r-- | include/net/netns/ipv4.h | 1 | ||||
-rw-r--r-- | include/net/route.h | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 848fe8056534..bc8f7f94abcb 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -80,6 +80,7 @@ struct netns_ipv4 { | |||
80 | int sysctl_tcp_ecn; | 80 | int sysctl_tcp_ecn; |
81 | int sysctl_tcp_ecn_fallback; | 81 | int sysctl_tcp_ecn_fallback; |
82 | 82 | ||
83 | int sysctl_ip_default_ttl; | ||
83 | int sysctl_ip_no_pmtu_disc; | 84 | int sysctl_ip_no_pmtu_disc; |
84 | int sysctl_ip_fwd_use_pmtu; | 85 | int sysctl_ip_fwd_use_pmtu; |
85 | int sysctl_ip_nonlocal_bind; | 86 | int sysctl_ip_nonlocal_bind; |
diff --git a/include/net/route.h b/include/net/route.h index a3b9ef74a389..9b0a523bb428 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -329,14 +329,13 @@ static inline int inet_iif(const struct sk_buff *skb) | |||
329 | return skb->skb_iif; | 329 | return skb->skb_iif; |
330 | } | 330 | } |
331 | 331 | ||
332 | extern int sysctl_ip_default_ttl; | ||
333 | |||
334 | static inline int ip4_dst_hoplimit(const struct dst_entry *dst) | 332 | static inline int ip4_dst_hoplimit(const struct dst_entry *dst) |
335 | { | 333 | { |
336 | int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT); | 334 | int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT); |
335 | struct net *net = dev_net(dst->dev); | ||
337 | 336 | ||
338 | if (hoplimit == 0) | 337 | if (hoplimit == 0) |
339 | hoplimit = sysctl_ip_default_ttl; | 338 | hoplimit = net->ipv4.sysctl_ip_default_ttl; |
340 | return hoplimit; | 339 | return hoplimit; |
341 | } | 340 | } |
342 | 341 | ||