Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp834422ybi; Fri, 12 Jul 2019 05:25:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7RRwhLozgcAfz7FUiogueX0HhZjpOmwCnAgBkbBbHKaZTQH84L+w7gVlgyNgTHVhWXfiC X-Received: by 2002:a17:902:549:: with SMTP id 67mr11178076plf.86.1562934353331; Fri, 12 Jul 2019 05:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934353; cv=none; d=google.com; s=arc-20160816; b=008b5/dnx5OExCNJRKGWTB+itmgEJVKvc+WEMnA1dzbue2DjaRgEMGS/vg0R44JGmH sHhdx3CLWkCTL/DMjDBHgthx7kUpmcmNkQI3+Ju9//FKmqDbxXCjVVafwJQioOUsT+Oj AImZ/yx9Du3lZZND17UODZ9IHYx8n2Kr+2+7H0vT2Ne8Hwv+SP+dM+/1cjcgMz8j17O9 GX4qQlNjSSmB6ySiaVZB5GOlrbIUOBZfM8AnPPyD6zuyQwPo83bBW0M9DS+MjXrrU4Jl UIOJdhpxpkDiWKBgNzUq0lzYOIfNsfxgejF1L+jbix7v4VZC5eGIHfSRD+2QaX3coz/S ZHJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y1WDY3Znd6ZqwTW3zOTzr2NCcbR6wQiao/A5xtYOz80=; b=JpfB4vnQufPJOaWUj4JN4gRw2J2vm1FfnoVgjdYM2sal0misogYEb7XUHxslQ8GmtT vJ0SLMdy8YmVsJ19ZePnVObgVObbrdopEG1mYASZYrWcr2dZm+aAFjT2PgyrzjHtWYtG 2qj/oazLIAkXMLz2ge0VB4bBVKmm2ZAcTJGgnwaVoahxtnDjAXs9JCJYC2KBUuYxDuiI wmYObUmpLG8NJPnlfB+dX8Y6jgFRGaPCr3ZqZL2d6F7g4NjmvE5sFBmNvMd77NKxCmg+ BxJcJ8OG71a4RoAj45u9UMnCuGWbAdeAkwXnlk2D3l5s5xWnIDJHEF7jX+3z077g9uRf sVtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ynkro9EY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z185si8281766pfb.109.2019.07.12.05.25.38; Fri, 12 Jul 2019 05:25:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ynkro9EY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727165AbfGLMYg (ORCPT + 99 others); Fri, 12 Jul 2019 08:24:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:33326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728144AbfGLMYe (ORCPT ); Fri, 12 Jul 2019 08:24:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 590122084B; Fri, 12 Jul 2019 12:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934273; bh=jJIdsp0EhhdWqql7R9UjK47yBHa1g72/qTxDgzXP6Lc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ynkro9EYy9LTk+cnDNAKKuNUwUE9iqbxg5s9P4O5Jrtr7clhX57RGDm8W36S8nxhG pRjPGukFhx/TxMdK3KdjWwOXmX01i5rM5aoYL8JmDdr800X6bJgvB7sOdtFGy/TGtc gWhlMCNcEgquZ/Mv09q4g2laD1dXr70N2PqhIpTs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xin Long , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 49/91] ip6_tunnel: allow not to count pkts on tstats by passing dev as NULL Date: Fri, 12 Jul 2019 14:18:52 +0200 Message-Id: <20190712121624.257889987@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121621.422224300@linuxfoundation.org> References: <20190712121621.422224300@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 6f6a8622057c92408930c31698394fae1557b188 ] A similar fix to Patch "ip_tunnel: allow not to count pkts on tstats by setting skb's dev to NULL" is also needed by ip6_tunnel. Signed-off-by: Xin Long Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/net/ip6_tunnel.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 236e40ba06bf..f594eb71c274 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h @@ -156,9 +156,12 @@ static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb, memset(skb->cb, 0, sizeof(struct inet6_skb_parm)); pkt_len = skb->len - skb_inner_network_offset(skb); err = ip6_local_out(dev_net(skb_dst(skb)->dev), sk, skb); - if (unlikely(net_xmit_eval(err))) - pkt_len = -1; - iptunnel_xmit_stats(dev, pkt_len); + + if (dev) { + if (unlikely(net_xmit_eval(err))) + pkt_len = -1; + iptunnel_xmit_stats(dev, pkt_len); + } } #endif #endif -- 2.20.1