diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2015-09-16 01:04:03 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-18 00:18:34 (GMT) |
commit | 758ccac8e7419ae746bcda807919a547ed9cdaad (patch) | |
tree | 28792745c988b61a1883fb782a822dbf18220e7d /net/ipv4/ipmr.c | |
parent | 38184b3b073bf588d809d3b2fb7370264357c289 (diff) | |
download | linux-758ccac8e7419ae746bcda807919a547ed9cdaad.tar.xz |
ipv4: Only compute net once in ipmr_forward_finish
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipmr.c')
-rw-r--r-- | net/ipv4/ipmr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 075bc69..dfe4e8e 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -1681,9 +1681,10 @@ static void ip_encap(struct net *net, struct sk_buff *skb, static inline int ipmr_forward_finish(struct sock *sk, struct sk_buff *skb) { struct ip_options *opt = &(IPCB(skb)->opt); + struct net *net = dev_net(skb_dst(skb)->dev); - 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); |