summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-05-03 23:02:36 -0400
committerGitHub <noreply@github.com>2018-05-03 23:02:36 -0400
commit1c96f2fb9631415ec44046c915520f489a93ebc4 (patch)
tree8f3c9da58a92e32c7c2233e29620637c303655d0
parent87e6a84061f284279cbee1d7278f785c7fbd77fc (diff)
parent53765081f9db69344b9027084208a08b28f7bb02 (diff)
Merge pull request #2169 from piotrjurkiewicz/eigrp_feasibility
eigrpd: Consider only feasible successors as successors
-rw-r--r--eigrpd/eigrp_topology.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/eigrpd/eigrp_topology.c b/eigrpd/eigrp_topology.c
index 2d1bc46e6b..becb29a95f 100644
--- a/eigrpd/eigrp_topology.c
+++ b/eigrpd/eigrp_topology.c
@@ -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;