From: Eric W. Biederman Date: Wed, 16 Sep 2015 01:03:55 +0000 (-0500) Subject: ipv4: Compute net once in ip_forward_finish X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f8e1ac7912700914e4d6d129d38ecbcff8e4f4c4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ipv4: Compute net once in ip_forward_finish Signed-off-by: "Eric W. Biederman" Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index ba2f66b3b3f6..95235c813f18 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c @@ -63,10 +63,11 @@ static bool ip_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu) static int ip_forward_finish(struct sock *sk, struct sk_buff *skb) { + struct net *net = dev_net(skb_dst(skb)->dev); struct ip_options *opt = &(IPCB(skb)->opt); - IP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTFORWDATAGRAMS); - IP_ADD_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTOCTETS, skb->len); + IP_INC_STATS_BH(net, IPSTATS_MIB_OUTFORWDATAGRAMS); + IP_ADD_STATS_BH(net, IPSTATS_MIB_OUTOCTETS, skb->len); if (unlikely(opt->optlen)) ip_forward_options(skb);