提交 fd739b15 编写于 作者: D David Ahern 提交者: Zheng Zengkai

ipv6: Fix stats accounting in ip6_pkt_drop

stable inclusion
from stable-v5.10.111
commit e3dd1202ab2ef81a69dbc20e18945b369dddea81
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5GL1Z

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e3dd1202ab2ef81a69dbc20e18945b369dddea81

--------------------------------

[ Upstream commit 1158f79f ]

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: NPudak, Filip <Filip.Pudak@windriver.com>
Reported-by: NXiao, Jiguang <Jiguang.Xiao@windriver.com>
Signed-off-by: NDavid Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20220404150908.2937-1-dsahern@kernel.orgSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 72a70d58
...@@ -4393,7 +4393,7 @@ static int ip6_pkt_drop(struct sk_buff *skb, u8 code, int ipstats_mib_noroutes) ...@@ -4393,7 +4393,7 @@ static int ip6_pkt_drop(struct sk_buff *skb, u8 code, int ipstats_mib_noroutes)
struct inet6_dev *idev; struct inet6_dev *idev;
int type; int type;
if (netif_is_l3_master(skb->dev) && if (netif_is_l3_master(skb->dev) ||
dst->dev == net->loopback_dev) dst->dev == net->loopback_dev)
idev = __in6_dev_get_safely(dev_get_by_index_rcu(net, IP6CB(skb)->iif)); idev = __in6_dev_get_safely(dev_get_by_index_rcu(net, IP6CB(skb)->iif));
else else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册