Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c154cf18 authored by David Ahern's avatar David Ahern Committed by Greg Kroah-Hartman
Browse files

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: 1d3fd8a1 ("vrf: Use orig netdev to count Ip6InNoRoutes and a fresh route lookup when sending dest unreach")
Reported-by: default avatarPudak, Filip <Filip.Pudak@windriver.com>
Reported-by: default avatarXiao, Jiguang <Jiguang.Xiao@windriver.com>
Signed-off-by: default avatarDavid Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20220404150908.2937-1-dsahern@kernel.org


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent fbe5f4c0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4403,7 +4403,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