提交 3f0ae05d 编写于 作者: Z Zhang Shengju 提交者: David S. Miller

rtnl: fix the loop index update error in rtnl_dump_ifinfo()

If the link is filtered out, loop index should also be updated. If not,
loop index will not be correct.

Fixes: dc599f76 ("net: Add support for filtering link dump by master device and kind")
Signed-off-by: NZhang Shengju <zhangshengju@cmss.chinamobile.com>
Acked-by: NDavid Ahern <dsa@cumulusnetworks.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 32c23116
...@@ -1609,7 +1609,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -1609,7 +1609,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
head = &net->dev_index_head[h]; head = &net->dev_index_head[h];
hlist_for_each_entry(dev, head, index_hlist) { hlist_for_each_entry(dev, head, index_hlist) {
if (link_dump_filtered(dev, master_idx, kind_ops)) if (link_dump_filtered(dev, master_idx, kind_ops))
continue; goto cont;
if (idx < s_idx) if (idx < s_idx)
goto cont; goto cont;
err = rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK, err = rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册