From patchwork Mon Apr 4 15:09:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ahern X-Patchwork-Id: 12800371 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E49E9C433F5 for ; Mon, 4 Apr 2022 15:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378184AbiDDPLK (ORCPT ); Mon, 4 Apr 2022 11:11:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377985AbiDDPLJ (ORCPT ); Mon, 4 Apr 2022 11:11:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4211C13D3A for ; Mon, 4 Apr 2022 08:09:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C1562615BE for ; Mon, 4 Apr 2022 15:09:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB3CBC340EE; Mon, 4 Apr 2022 15:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649084952; bh=4MD4RKOkcZXCDxme5MpGD9pTFwCi1YFfE4z1oJFE1VI=; h=From:To:Cc:Subject:Date:From; b=Ep6+mEi2jnfKUQ0apY6BSQgPhltC7axQPDmNzfA34hJ/Zuym4hN/Z3KoJOiggeHYt pTXYKKTIYbJPCBsRTz5HNp6azqLXLsdnJDH7JqQLNawai0+sO5IvhWfnPKmzsVqkqm F42IXGJzaNLxDTBEH/bfI7gJAtimQtuph/3jJuG/SjDMcUjEn/1Lq9kIOfRuBkVdMQ 8tv56CreTVopTEEGPed4YeHnTWKTg+WRfgZN9clOiRqjUxutBRn0lOHGbZWImVhsrm PnNOs1TFclV3CviJjqa0kOlLOqoi0OK9d5zzFt41n+xB7I0SAFbAv9rgvgdGyXOCKb CuCHFUC2ACDQQ== From: David Ahern To: netdev@vger.kernel.org, kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com Cc: Filip.Pudak@windriver.com, Jiguang.Xiao@windriver.com, ssuryaextr@gmail.com, David Ahern , Pudak@vger.kernel.org, Xiao@vger.kernel.org Subject: [PATCH net] ipv6: Fix stats accounting in ip6_pkt_drop Date: Mon, 4 Apr 2022 09:09:08 -0600 Message-Id: <20220404150908.2937-1-dsahern@kernel.org> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org VRF devices are the loopbacks for VRFs, and a loopback can not be assigned to a VRF. Accordingly, the condition in ip6_pkt_drop should be '||' not '&&'. Fixes: 1d3fd8a10bed ("vrf: Use orig netdev to count Ip6InNoRoutes and a fresh route lookup when sending dest unreach") Reported-by: Pudak, Filip Reported-by: Xiao, Jiguang Signed-off-by: David Ahern --- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 2fa10e60cccd..169e9df6d172 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -4484,7 +4484,7 @@ static int ip6_pkt_drop(struct sk_buff *skb, u8 code, int ipstats_mib_noroutes) struct inet6_dev *idev; int type; - if (netif_is_l3_master(skb->dev) && + if (netif_is_l3_master(skb->dev) || dst->dev == net->loopback_dev) idev = __in6_dev_get_safely(dev_get_by_index_rcu(net, IP6CB(skb)->iif)); else