diff options
| author | Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com> | 2018-05-04 02:28:29 +0200 | 
|---|---|---|
| committer | Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com> | 2018-05-04 03:01:29 +0200 | 
| commit | 53765081f9db69344b9027084208a08b28f7bb02 (patch) | |
| tree | ab5c6585f8900ffba1175c4a9ff1bd767c238360 /eigrpd/eigrp_topology.c | |
| parent | babf583e630d7ed7a7dd3920996e90f5728a6ead (diff) | |
eigrpd: Consider only feasible successors as successors
Meeting the feasibility condition is required also for routes
meeting the variance condition.
Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
Diffstat (limited to 'eigrpd/eigrp_topology.c')
| -rw-r--r-- | eigrpd/eigrp_topology.c | 29 | 
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;  | 
