summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Shengju <zhangshengju@cmss.chinamobile.com>2016-11-19 23:28:32 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-12-10 19:09:38 +0100
commit58c8cc33de6caa707cec2008782f918432668962 (patch)
treebe470c32ce27683a1814cdec8597e47418a1ecdc
parent84df56749f48aed274bbfd2db6b6fb9dd540ff6b (diff)
downloadlinux-58c8cc33de6caa707cec2008782f918432668962.tar.gz
linux-58c8cc33de6caa707cec2008782f918432668962.tar.bz2
linux-58c8cc33de6caa707cec2008782f918432668962.zip
rtnl: fix the loop index update error in rtnl_dump_ifinfo()
[ Upstream commit 3f0ae05d6fea0ed5b19efdbc9c9f8e02685a3af3 ] If the link is filtered out, loop index should also be updated. If not, loop index will not be correct. Fixes: dc599f76c22b0 ("net: Add support for filtering link dump by master device and kind") Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Acked-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/core/rtnetlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 9b39088e9077..08c3702f7074 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1578,7 +1578,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
head = &net->dev_index_head[h];
hlist_for_each_entry(dev, head, index_hlist) {
if (link_dump_filtered(dev, master_idx, kind_ops))
- continue;
+ goto cont;
if (idx < s_idx)
goto cont;
err = rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,