]> git.baikalelectronics.ru Git - kernel.git/commitdiff
vxlan: fix last fdb index during dump of fdb with nhid
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Wed, 24 Jun 2020 21:02:36 +0000 (14:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Jun 2020 23:12:34 +0000 (16:12 -0700)
This patch fixes last saved fdb index in fdb dump handler when
handling fdb's with nhid.

Fixes: feeface2e67a ("vxlan: ecmp support for mac fdb entries")
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c

index e8085ab6d4849b89e70aba97d6f0f6e343c002fa..89d85dcb200e88548dd563e9e98e1ac1bfdcf8c6 100644 (file)
@@ -1380,6 +1380,8 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
                        struct vxlan_rdst *rd;
 
                        if (rcu_access_pointer(f->nh)) {
+                               if (*idx < cb->args[2])
+                                       goto skip_nh;
                                err = vxlan_fdb_info(skb, vxlan, f,
                                                     NETLINK_CB(cb->skb).portid,
                                                     cb->nlh->nlmsg_seq,
@@ -1387,6 +1389,8 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
                                                     NLM_F_MULTI, NULL);
                                if (err < 0)
                                        goto out;
+skip_nh:
+                               *idx += 1;
                                continue;
                        }