diff options
author | Cong Wang <amwang@redhat.com> | 2013-08-31 01:44:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-31 22:29:59 -0400 |
commit | 3ce9b35ff6de8dfebb0b0045e667c000f632e563 (patch) | |
tree | ecde35b0c857ba52ef90724bf12f037f52ab4957 /net/ipv6 | |
parent | ae5dbf1ad83cb90921a400d15fb18afae66e1e56 (diff) |
ipv6: move ip6_dst_hoplimit() into core kernel
It will be used by vxlan, and may not be inlined.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/output_core.c | 22 | ||||
-rw-r--r-- | net/ipv6/route.c | 19 |
2 files changed, 22 insertions, 19 deletions
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c index ab92a3673fbb..53a062187db1 100644 --- a/net/ipv6/output_core.c +++ b/net/ipv6/output_core.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/export.h> | 5 | #include <linux/export.h> |
6 | #include <net/ipv6.h> | 6 | #include <net/ipv6.h> |
7 | #include <net/ip6_fib.h> | 7 | #include <net/ip6_fib.h> |
8 | #include <net/addrconf.h> | ||
8 | 9 | ||
9 | void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt) | 10 | void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt) |
10 | { | 11 | { |
@@ -75,3 +76,24 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr) | |||
75 | return offset; | 76 | return offset; |
76 | } | 77 | } |
77 | EXPORT_SYMBOL(ip6_find_1stfragopt); | 78 | EXPORT_SYMBOL(ip6_find_1stfragopt); |
79 | |||
80 | #if IS_ENABLED(CONFIG_IPV6) | ||
81 | int ip6_dst_hoplimit(struct dst_entry *dst) | ||
82 | { | ||
83 | int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT); | ||
84 | if (hoplimit == 0) { | ||
85 | struct net_device *dev = dst->dev; | ||
86 | struct inet6_dev *idev; | ||
87 | |||
88 | rcu_read_lock(); | ||
89 | idev = __in6_dev_get(dev); | ||
90 | if (idev) | ||
91 | hoplimit = idev->cnf.hop_limit; | ||
92 | else | ||
93 | hoplimit = dev_net(dev)->ipv6.devconf_all->hop_limit; | ||
94 | rcu_read_unlock(); | ||
95 | } | ||
96 | return hoplimit; | ||
97 | } | ||
98 | EXPORT_SYMBOL(ip6_dst_hoplimit); | ||
99 | #endif | ||
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 55236a84c748..b770085ae36d 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1354,25 +1354,6 @@ out: | |||
1354 | return entries > rt_max_size; | 1354 | return entries > rt_max_size; |
1355 | } | 1355 | } |
1356 | 1356 | ||
1357 | int ip6_dst_hoplimit(struct dst_entry *dst) | ||
1358 | { | ||
1359 | int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT); | ||
1360 | if (hoplimit == 0) { | ||
1361 | struct net_device *dev = dst->dev; | ||
1362 | struct inet6_dev *idev; | ||
1363 | |||
1364 | rcu_read_lock(); | ||
1365 | idev = __in6_dev_get(dev); | ||
1366 | if (idev) | ||
1367 | hoplimit = idev->cnf.hop_limit; | ||
1368 | else | ||
1369 | hoplimit = dev_net(dev)->ipv6.devconf_all->hop_limit; | ||
1370 | rcu_read_unlock(); | ||
1371 | } | ||
1372 | return hoplimit; | ||
1373 | } | ||
1374 | EXPORT_SYMBOL(ip6_dst_hoplimit); | ||
1375 | |||
1376 | /* | 1357 | /* |
1377 | * | 1358 | * |
1378 | */ | 1359 | */ |