]> git.puffer.fish Git - mirror/frr.git/commitdiff
eigrpd: Consider only feasible successors as successors 2169/head
authorPiotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
Fri, 4 May 2018 00:28:29 +0000 (02:28 +0200)
committerPiotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
Fri, 4 May 2018 01:01:29 +0000 (03:01 +0200)
Meeting the feasibility condition is required also for routes
meeting the variance condition.

Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
eigrpd/eigrp_topology.c

index 2d1bc46e6b5d905e7e1563c8aa60207934b1d483..becb29a95faafb530994c6303284b98eeeaf1daf 100644 (file)
@@ -443,17 +443,24 @@ void eigrp_topology_update_node_flags(struct eigrp_prefix_entry *dest)
        struct eigrp *eigrp = eigrp_lookup();
 
        for (ALL_LIST_ELEMENTS_RO(dest->entries, node, entry)) {
-               if (((uint64_t)entry->distance
-                    <= (uint64_t)dest->distance * (uint64_t)eigrp->variance)
-                   && entry->distance != EIGRP_MAX_METRIC) // is successor
-               {
-                       entry->flags |= EIGRP_NEXTHOP_ENTRY_SUCCESSOR_FLAG;
-                       entry->flags &= ~EIGRP_NEXTHOP_ENTRY_FSUCCESSOR_FLAG;
-               } else if (entry->reported_distance
-                          < dest->fdistance) // is feasible successor
-               {
-                       entry->flags |= EIGRP_NEXTHOP_ENTRY_FSUCCESSOR_FLAG;
-                       entry->flags &= ~EIGRP_NEXTHOP_ENTRY_SUCCESSOR_FLAG;
+               if (entry->reported_distance < dest->fdistance) {
+                       // is feasible successor, can be successor
+                       if (((uint64_t)entry->distance
+                            <= (uint64_t)dest->distance
+                                       * (uint64_t)eigrp->variance)
+                           && entry->distance != EIGRP_MAX_METRIC) {
+                               // is successor
+                               entry->flags |=
+                                       EIGRP_NEXTHOP_ENTRY_SUCCESSOR_FLAG;
+                               entry->flags &=
+                                       ~EIGRP_NEXTHOP_ENTRY_FSUCCESSOR_FLAG;
+                       } else {
+                               // is feasible successor only
+                               entry->flags |=
+                                       EIGRP_NEXTHOP_ENTRY_FSUCCESSOR_FLAG;
+                               entry->flags &=
+                                       ~EIGRP_NEXTHOP_ENTRY_SUCCESSOR_FLAG;
+                       }
                } else {
                        entry->flags &= ~EIGRP_NEXTHOP_ENTRY_FSUCCESSOR_FLAG;
                        entry->flags &= ~EIGRP_NEXTHOP_ENTRY_SUCCESSOR_FLAG;