aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/route.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f7702850d45c..8f2d0400cf8a 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1084,11 +1084,11 @@ static int ipv6_get_mtu(struct net_device *dev)
1084 int mtu = IPV6_MIN_MTU; 1084 int mtu = IPV6_MIN_MTU;
1085 struct inet6_dev *idev; 1085 struct inet6_dev *idev;
1086 1086
1087 idev = in6_dev_get(dev); 1087 rcu_read_lock();
1088 if (idev) { 1088 idev = __in6_dev_get(dev);
1089 if (idev)
1089 mtu = idev->cnf.mtu6; 1090 mtu = idev->cnf.mtu6;
1090 in6_dev_put(idev); 1091 rcu_read_unlock();
1091 }
1092 return mtu; 1092 return mtu;
1093} 1093}
1094 1094
@@ -1097,12 +1097,15 @@ int ip6_dst_hoplimit(struct dst_entry *dst)
1097 int hoplimit = dst_metric(dst, RTAX_HOPLIMIT); 1097 int hoplimit = dst_metric(dst, RTAX_HOPLIMIT);
1098 if (hoplimit < 0) { 1098 if (hoplimit < 0) {
1099 struct net_device *dev = dst->dev; 1099 struct net_device *dev = dst->dev;
1100 struct inet6_dev *idev = in6_dev_get(dev); 1100 struct inet6_dev *idev;
1101 if (idev) { 1101
1102 rcu_read_lock();
1103 idev = __in6_dev_get(dev);
1104 if (idev)
1102 hoplimit = idev->cnf.hop_limit; 1105 hoplimit = idev->cnf.hop_limit;
1103 in6_dev_put(idev); 1106 else
1104 } else
1105 hoplimit = dev_net(dev)->ipv6.devconf_all->hop_limit; 1107 hoplimit = dev_net(dev)->ipv6.devconf_all->hop_limit;
1108 rcu_read_unlock();
1106 } 1109 }
1107 return hoplimit; 1110 return hoplimit;
1108} 1111}