forked from Mirror/frr
[zebra] Fix incorrect changes made in RIB metric selection patch
2006-01-25 Gunnar Stigen <gunnar.stigen@axxessit.no> * zebra_rib.c: (rib_process) Application of Gunnar's earlier metric selection RIB change included incorrect tidy-ups made by commiter. Fix. (NB: any errors here are again due to paul).
This commit is contained in:
parent
5c78b3d006
commit
a8d9c1f9ca
|
@ -1,3 +1,9 @@
|
||||||
|
2006-01-25 Gunnar Stigen <gunnar.stigen@axxessit.no>
|
||||||
|
|
||||||
|
* zebra_rib.c: (rib_process) Application of Gunnar's earlier
|
||||||
|
metric selection RIB change included incorrect tidy-ups made
|
||||||
|
by commiter. Fix. (NB: any errors here are again due to paul).
|
||||||
|
|
||||||
2006-01-25 Paul Jakma <paul.jakma@sun.com>
|
2006-01-25 Paul Jakma <paul.jakma@sun.com>
|
||||||
|
|
||||||
* (general) More solaris PF_ROUTE hacks. The IFF_UP mangling
|
* (general) More solaris PF_ROUTE hacks. The IFF_UP mangling
|
||||||
|
|
|
@ -927,15 +927,37 @@ rib_process (struct work_queue *wq, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* filter route selection in following order:
|
/* filter route selection in following order:
|
||||||
* - lower distance beats higher
|
|
||||||
* - connected beats other types
|
* - connected beats other types
|
||||||
|
* - lower distance beats higher
|
||||||
* - lower metric beats higher for equal distance
|
* - lower metric beats higher for equal distance
|
||||||
* - last, hence oldest, route wins tie break.
|
* - last, hence oldest, route wins tie break.
|
||||||
*/
|
*/
|
||||||
if ((rib->type == ZEBRA_ROUTE_CONNECT)
|
if (rib->type == ZEBRA_ROUTE_CONNECT)
|
||||||
|| (rib->distance <= select->distance))
|
{
|
||||||
if (rib->metric <= select->metric)
|
if (select->type != ZEBRA_ROUTE_CONNECT
|
||||||
|
|| rib->metric <= select->metric)
|
||||||
|
{
|
||||||
|
select = rib;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (select->type == ZEBRA_ROUTE_CONNECT)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* higher distance loses */
|
||||||
|
if (rib->distance > select->distance)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* lower wins */
|
||||||
|
if (rib->distance < select->distance)
|
||||||
|
{
|
||||||
select = rib;
|
select = rib;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* metric tie-breaks equal distance */
|
||||||
|
if (rib->metric <= select->metric)
|
||||||
|
select = rib;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Deleted route check. */
|
/* Deleted route check. */
|
||||||
|
|
Loading…
Reference in a new issue