Commit 6fa40a29 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

ip6mr: switch ip6mr_get_route() to rcu_read_lock()

Like ipmr_get_route(), we can use standard RCU here.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9b1c21d8
...@@ -2290,7 +2290,7 @@ int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm, ...@@ -2290,7 +2290,7 @@ int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm,
if (!mrt) if (!mrt)
return -ENOENT; return -ENOENT;
read_lock(&mrt_lock); rcu_read_lock();
cache = ip6mr_cache_find(mrt, &rt->rt6i_src.addr, &rt->rt6i_dst.addr); cache = ip6mr_cache_find(mrt, &rt->rt6i_src.addr, &rt->rt6i_dst.addr);
if (!cache && skb->dev) { if (!cache && skb->dev) {
int vif = ip6mr_find_vif(mrt, skb->dev); int vif = ip6mr_find_vif(mrt, skb->dev);
...@@ -2308,14 +2308,14 @@ int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm, ...@@ -2308,14 +2308,14 @@ int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm,
dev = skb->dev; dev = skb->dev;
if (!dev || (vif = ip6mr_find_vif(mrt, dev)) < 0) { if (!dev || (vif = ip6mr_find_vif(mrt, dev)) < 0) {
read_unlock(&mrt_lock); rcu_read_unlock();
return -ENODEV; return -ENODEV;
} }
/* really correct? */ /* really correct? */
skb2 = alloc_skb(sizeof(struct ipv6hdr), GFP_ATOMIC); skb2 = alloc_skb(sizeof(struct ipv6hdr), GFP_ATOMIC);
if (!skb2) { if (!skb2) {
read_unlock(&mrt_lock); rcu_read_unlock();
return -ENOMEM; return -ENOMEM;
} }
...@@ -2338,13 +2338,13 @@ int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm, ...@@ -2338,13 +2338,13 @@ int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm,
iph->daddr = rt->rt6i_dst.addr; iph->daddr = rt->rt6i_dst.addr;
err = ip6mr_cache_unresolved(mrt, vif, skb2, dev); err = ip6mr_cache_unresolved(mrt, vif, skb2, dev);
read_unlock(&mrt_lock); rcu_read_unlock();
return err; return err;
} }
err = mr_fill_mroute(mrt, skb, &cache->_c, rtm); err = mr_fill_mroute(mrt, skb, &cache->_c, rtm);
read_unlock(&mrt_lock); rcu_read_unlock();
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment