From: David Ahern <dsahern@kernel.org>
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 <dsahern@kernel.org>,
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 [thread overview]
Message-ID: <20220404150908.2937-1-dsahern@kernel.org> (raw)
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 <Filip.Pudak@windriver.com>
Reported-by: Xiao, Jiguang <Jiguang.Xiao@windriver.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
---
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
--
2.24.3 (Apple Git-128)
next reply other threads:[~2022-04-04 15:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-04 15:09 David Ahern [this message]
2022-04-05 13:20 ` [PATCH net] ipv6: Fix stats accounting in ip6_pkt_drop patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220404150908.2937-1-dsahern@kernel.org \
--to=dsahern@kernel.org \
--cc=Filip.Pudak@windriver.com \
--cc=Jiguang.Xiao@windriver.com \
--cc=Pudak@vger.kernel.org \
--cc=Xiao@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ssuryaextr@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.