From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric W. Biederman" Subject: [PATCH next 13/30] ipv4: Only compute net once in ip_finish_output2 Date: Tue, 15 Sep 2015 20:04:01 -0500 Message-ID: <1442365458-16349-13-git-send-email-ebiederm@xmission.com> References: <87mvwn18my.fsf@x220.int.ebiederm.org> Cc: netfilter-devel@vger.kernel.org, To: Pablo Neira Ayuso , David Miller Return-path: Received: from out03.mta.xmission.com ([166.70.13.233]:39401 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752580AbbIPBNm (ORCPT ); Tue, 15 Sep 2015 21:13:42 -0400 In-Reply-To: <87mvwn18my.fsf@x220.int.ebiederm.org> Sender: netdev-owner@vger.kernel.org List-ID: Signed-off-by: "Eric W. Biederman" --- net/ipv4/ip_output.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 095754c99061..fc550e97daac 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -177,14 +177,15 @@ static int ip_finish_output2(struct sock *sk, struct sk_buff *skb) struct dst_entry *dst = skb_dst(skb); struct rtable *rt = (struct rtable *)dst; struct net_device *dev = dst->dev; + struct net *net = dev_net(dev); unsigned int hh_len = LL_RESERVED_SPACE(dev); struct neighbour *neigh; u32 nexthop; if (rt->rt_type == RTN_MULTICAST) { - IP_UPD_PO_STATS(dev_net(dev), IPSTATS_MIB_OUTMCAST, skb->len); + IP_UPD_PO_STATS(net, IPSTATS_MIB_OUTMCAST, skb->len); } else if (rt->rt_type == RTN_BROADCAST) - IP_UPD_PO_STATS(dev_net(dev), IPSTATS_MIB_OUTBCAST, skb->len); + IP_UPD_PO_STATS(net, IPSTATS_MIB_OUTBCAST, skb->len); /* Be paranoid, rather than too clever. */ if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) { -- 2.2.1