diff mbox

[next,16/30] ipv6: Only compute net once in ip6mr_forward2_finish

Message ID 1442365458-16349-16-git-send-email-ebiederm@xmission.com
State Awaiting Upstream
Delegated to: Pablo Neira
Headers show

Commit Message

Eric W. Biederman Sept. 16, 2015, 1:04 a.m. UTC
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 net/ipv6/ip6mr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Nicolas Dichtel Sept. 17, 2015, 4 p.m. UTC | #1
Le 16/09/2015 03:04, Eric W. Biederman a écrit :
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> ---
>   net/ipv6/ip6mr.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
> index e95f6b6281de..3e3085b37a91 100644
> --- a/net/ipv6/ip6mr.c
> +++ b/net/ipv6/ip6mr.c
> @@ -1987,9 +1987,10 @@ int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
>
>   static inline int ip6mr_forward2_finish(struct sock *sk, struct sk_buff *skb)
>   {
> -	IP6_INC_STATS_BH(dev_net(skb_dst(skb)->dev), ip6_dst_idev(skb_dst(skb)),
> +	struct net *net = dev_net(skb_dst(skb)->dev);
nit: a blank line is needed after this declaration.

> +	IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)),
>   			 IPSTATS_MIB_OUTFORWDATAGRAMS);
> -	IP6_ADD_STATS_BH(dev_net(skb_dst(skb)->dev), ip6_dst_idev(skb_dst(skb)),
> +	IP6_ADD_STATS_BH(net, ip6_dst_idev(skb_dst(skb)),
>   			 IPSTATS_MIB_OUTOCTETS, skb->len);
>   	return dst_output(sk, skb);
>   }
>

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index e95f6b6281de..3e3085b37a91 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1987,9 +1987,10 @@  int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
 
 static inline int ip6mr_forward2_finish(struct sock *sk, struct sk_buff *skb)
 {
-	IP6_INC_STATS_BH(dev_net(skb_dst(skb)->dev), ip6_dst_idev(skb_dst(skb)),
+	struct net *net = dev_net(skb_dst(skb)->dev);
+	IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)),
 			 IPSTATS_MIB_OUTFORWDATAGRAMS);
-	IP6_ADD_STATS_BH(dev_net(skb_dst(skb)->dev), ip6_dst_idev(skb_dst(skb)),
+	IP6_ADD_STATS_BH(net, ip6_dst_idev(skb_dst(skb)),
 			 IPSTATS_MIB_OUTOCTETS, skb->len);
 	return dst_output(sk, skb);
 }