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

ipv6: avoid two atomics in ipv6_rthdr_rcv()

Use __in6_dev_get() instead of in6_dev_get()/in6_dev_put()
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1be3b5fe
...@@ -312,6 +312,7 @@ static int ipv6_destopt_rcv(struct sk_buff *skb) ...@@ -312,6 +312,7 @@ static int ipv6_destopt_rcv(struct sk_buff *skb)
Routing header. Routing header.
********************************/ ********************************/
/* called with rcu_read_lock() */
static int ipv6_rthdr_rcv(struct sk_buff *skb) static int ipv6_rthdr_rcv(struct sk_buff *skb)
{ {
struct inet6_skb_parm *opt = IP6CB(skb); struct inet6_skb_parm *opt = IP6CB(skb);
...@@ -324,12 +325,9 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb) ...@@ -324,12 +325,9 @@ static int ipv6_rthdr_rcv(struct sk_buff *skb)
struct net *net = dev_net(skb->dev); struct net *net = dev_net(skb->dev);
int accept_source_route = net->ipv6.devconf_all->accept_source_route; int accept_source_route = net->ipv6.devconf_all->accept_source_route;
idev = in6_dev_get(skb->dev); idev = __in6_dev_get(skb->dev);
if (idev) { if (idev && accept_source_route > idev->cnf.accept_source_route)
if (accept_source_route > idev->cnf.accept_source_route) accept_source_route = idev->cnf.accept_source_route;
accept_source_route = idev->cnf.accept_source_route;
in6_dev_put(idev);
}
if (!pskb_may_pull(skb, skb_transport_offset(skb) + 8) || if (!pskb_may_pull(skb, skb_transport_offset(skb) + 8) ||
!pskb_may_pull(skb, (skb_transport_offset(skb) + !pskb_may_pull(skb, (skb_transport_offset(skb) +
......
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