From: Zhang Shengju Date: Sat, 19 Nov 2016 15:28:32 +0000 (+0800) Subject: rtnl: fix the loop index update error in rtnl_dump_ifinfo() X-Git-Tag: v4.9-rc7~33^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f0ae05d6fea0ed5b19efdbc9c9f8e02685a3af3;p=platform%2Fkernel%2Flinux-amlogic.git 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: dc599f76c22b0 ("net: Add support for filtering link dump by master device and kind") Signed-off-by: Zhang Shengju Acked-by: David Ahern Signed-off-by: David S. Miller --- diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 2b9d7d08ed4d..a99917b5de33 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -1609,7 +1609,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,