]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: add debug for duplicate NH in dataplane array conversion
authorStephen Worley <sworley@cumulusnetworks.com>
Tue, 28 Jan 2020 20:20:18 +0000 (15:20 -0500)
committerStephen Worley <sworley@cumulusnetworks.com>
Thu, 26 Mar 2020 14:48:15 +0000 (10:48 -0400)
When we find a nexthop ID thats a duplicate in the code that converts
NHG rb trees into a flat list of nexthop IDs for the dataplane,
output a debug message.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/zebra_nhg.c

index 7b54c06836bf85020d2f347b95ee22637f2c0c75..6a14e53b4b36afcd07f5ee27261619ed7269ec08 100644 (file)
@@ -1896,17 +1896,24 @@ static uint8_t zebra_nhg_nhe2grp_internal(struct nh_grp *grp,
                                continue;
                        }
 
-                       /* Check for duplicate IDs, kernel doesn't like that */
+                       /* Check for duplicate IDs, ignore if found. */
                        for (int j = 0; j < i; j++) {
                                if (depend->id == grp[j].id)
                                        duplicate = true;
                        }
 
-                       if (!duplicate) {
-                               grp[i].id = depend->id;
-                               grp[i].weight = depend->nhg.nexthop->weight;
-                               i++;
+                       if (duplicate) {
+                               if (IS_ZEBRA_DEBUG_RIB_DETAILED
+                                   || IS_ZEBRA_DEBUG_NHG)
+                                       zlog_debug(
+                                               "%s: Nexthop ID (%u) is duplicate, not appending to dataplane install group",
+                                               __func__, depend->id);
+                               continue;
                        }
+
+                       grp[i].id = depend->id;
+                       grp[i].weight = depend->nhg.nexthop->weight;
+                       i++;
                }
        }