瀏覽代碼

vxlan: fix fdb_dump index calculation

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 <atzm@iij.ad.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Atzm Watanabe 10 年之前
父節點
當前提交
07a51cd379
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      drivers/net/vxlan.c

+ 5 - 5
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) {
 		hlist_for_each_entry_rcu(f, &vxlan->fdb_head[h], hlist) {
 			struct vxlan_rdst *rd;
 			struct vxlan_rdst *rd;
 
 
-			if (idx < cb->args[0])
-				goto skip;
-
 			list_for_each_entry_rcu(rd, &f->remotes, list) {
 			list_for_each_entry_rcu(rd, &f->remotes, list) {
+				if (idx < cb->args[0])
+					goto skip;
+
 				err = vxlan_fdb_info(skb, vxlan, f,
 				err = vxlan_fdb_info(skb, vxlan, f,
 						     NETLINK_CB(cb->skb).portid,
 						     NETLINK_CB(cb->skb).portid,
 						     cb->nlh->nlmsg_seq,
 						     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);
 						     NLM_F_MULTI, rd);
 				if (err < 0)
 				if (err < 0)
 					goto out;
 					goto out;
-			}
 skip:
 skip:
-			++idx;
+				++idx;
+			}
 		}
 		}
 	}
 	}
 out:
 out: