Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp847871ybi; Fri, 12 Jul 2019 05:38:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1D+LdhulBfrY6wWq96NNaMfvmJ5w9wJ7yhtPUC9encOXtrN78DcJQNUae9Sjqp2gFH4rV X-Received: by 2002:a17:902:a607:: with SMTP id u7mr11319028plq.43.1562935135345; Fri, 12 Jul 2019 05:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935135; cv=none; d=google.com; s=arc-20160816; b=oNP63c67jozrq3jQ+PdUJRZmTIHVMBHebUrLjJ9M1uOsuKlM5OKwLgg0ZYFl7NbfIN VHmriSwM1OBHb0BkBUgY8epm0tpu4laKgqOj762LmGnSUo3gDnS3OstdV9p/k3ebeJN2 9fhMS8CCgZtwYN9omXFkPMX8U+XQMjT1CfKJ0G8RLAtWKg5X/Ihzvx8+O0lOjZrpo2kG ZrVMUt4/evTWytJOYkRVeslxgioFt0jiabzpTLGUavpxmwC2Z5XnjGt/cHQKiyA4ozvZ b1+uovlY7UfDGLpPAlGiJzqgF0j0TSZcR0LpmF27Wdks+cvThvKlonhghDDp0ilgSwr8 0dFQ== 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=1vAxH9dCD9rCBbhhcMom9eu1R5TqFVLYsYm20SC8TRI=; b=lwEVljPQWpKR28sfY4w2F1r8ytsg8Cf3J5XIsOnihWXzRCVQGBEmr9IKs3/tCmb/Xq UpTyHyM3iU2oXL7yN/GNmaPkl1yjtcem9WYgnDZxzUFxbn8SlHAIeba9DE5zV8xH6r1l QjOSZSDCKDuRUfTyAQTVOtbUe/XKLXWar4afs78x73/zMYhtYJv2ePIKK/YmluWFmW47 Vfm/0ygtBgCutugPUnk21qQavKhZtO9ytL050RjDxQ45szBk0xiUNblsNgISXAodRm1S yMm1h+pRaWjjFIS+Q6BVykUVlvGHhkZdvzaOKFgIvzQ5Y5K0EnzeDZrnqH8T8ypIdQM5 VsOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Uba+g9EC; 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 b28si8732765pfp.92.2019.07.12.05.38.40; Fri, 12 Jul 2019 05:38:55 -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=Uba+g9EC; 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 S1729244AbfGLMat (ORCPT + 99 others); Fri, 12 Jul 2019 08:30:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:46822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729233AbfGLMaq (ORCPT ); Fri, 12 Jul 2019 08:30:46 -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 DBF5421670; Fri, 12 Jul 2019 12:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934645; bh=TgPZJuMQcOYccz3yoY3iYpIlvUMnOuuAel8rbTPqNck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uba+g9ECV07SpcuVQAbB0inP4OZWy7Nub2kah5a6sAm+V5Ce6egwQXVjyhtz/OWmF HJxOHw7ypQSG1c/WgeyTWxq3lexmu3mAHJBJNm7M78YpZ/WJ3mQAQuxfF6szcyHox9 vIL3zKUv57wCPLtTf7hbsTN6+5NCreZAxrtHaaJw= 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 5.1 080/138] ip6_tunnel: allow not to count pkts on tstats by passing dev as NULL Date: Fri, 12 Jul 2019 14:19:04 +0200 Message-Id: <20190712121631.802855383@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@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 69b4bcf880c9..028eaea1c854 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h @@ -158,9 +158,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