From: David Ahern Date: Mon, 4 Apr 2022 15:09:08 +0000 (-0600) Subject: ipv6: Fix stats accounting in ip6_pkt_drop X-Git-Tag: v5.10.111~56 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e3dd1202ab2ef81a69dbc20e18945b369dddea81;p=users%2Fdwmw2%2Flinux.git ipv6: Fix stats accounting in ip6_pkt_drop [ Upstream commit 1158f79f82d437093aeed87d57df0548bdd68146 ] 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 Link: https://lore.kernel.org/r/20220404150908.2937-1-dsahern@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 352e645c546eb..776b1b58c5dc6 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -4398,7 +4398,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