From: Atzm Watanabe Subject: [PATCH net-next] vxlan: fix fdb_dump index calculation Date: Mon, 10 Aug 2015 23:39:09 +0900 Message-ID: <871tfb6wdu.wl%atzm@iij.ad.jp> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII To: davem@davemloft.net, netdev@vger.kernel.org Return-path: Received: from mo00.iij.ad.jp ([202.232.30.145]:51599 "EHLO omgo.iij.ad.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbbHJOtk (ORCPT ); Mon, 10 Aug 2015 10:49:40 -0400 Sender: netdev-owner@vger.kernel.org List-ID: When too many remotes are bound to an FDB entry, index may not be increased. This problem will be caused on the large scale environment that is based on the unicast default destination, for instance. Signed-off-by: Atzm Watanabe --- drivers/net/vxlan.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index b6731fa..06c0731 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -931,10 +931,10 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, hlist_for_each_entry_rcu(f, &vxlan->fdb_head[h], hlist) { struct vxlan_rdst *rd; - if (idx < cb->args[0]) - goto skip; - list_for_each_entry_rcu(rd, &f->remotes, list) { + if (idx < cb->args[0]) + goto skip; + err = vxlan_fdb_info(skb, vxlan, f, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, @@ -942,9 +942,9 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, NLM_F_MULTI, rd); if (err < 0) goto out; - } skip: - ++idx; + ++idx; + } } } out: -- 2.4.6