]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: break if duplicate nexthop found in nhe2grp 5740/head
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 26 Mar 2020 14:57:45 +0000 (10:57 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Thu, 26 Mar 2020 14:57:45 +0000 (10:57 -0400)
If we find that a nexthop is a duplicate, break immediately
rather than continuing to look through the rest of the list.

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

index c2582b93e12f8e8798f30d57f440dbce48352f3b..dc0af050d78c9bcc2a1d4237f8604b349d19f75c 100644 (file)
@@ -1929,8 +1929,10 @@ static uint8_t zebra_nhg_nhe2grp_internal(struct nh_grp *grp,
 
                        /* Check for duplicate IDs, ignore if found. */
                        for (int j = 0; j < i; j++) {
-                               if (depend->id == grp[j].id)
+                               if (depend->id == grp[j].id) {
                                        duplicate = true;
+                                       break;
+                               }
                        }
 
                        if (duplicate) {