mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 17:51:53 +00:00
If the user has specified identical preferences for instances of different
protocols, break the tie by comparing addresses, so we keep the ordering unambiguous.
This commit is contained in:
parent
aee539f241
commit
4c1b4e1a58
@ -95,7 +95,14 @@ rte_better(rte *new, rte *old)
|
|||||||
if (new->pref < old->pref)
|
if (new->pref < old->pref)
|
||||||
return 0;
|
return 0;
|
||||||
if (new->attrs->proto->proto != old->attrs->proto->proto)
|
if (new->attrs->proto->proto != old->attrs->proto->proto)
|
||||||
bug("Different protocols, but identical preferences => oops"); /* FIXME */
|
{
|
||||||
|
/*
|
||||||
|
* If the user has configured protocol preferences, so that two different protocols
|
||||||
|
* have the same preference, try to break the tie by comparing addresses. Not too
|
||||||
|
* useful, but keeps the ordering of routes unambiguous.
|
||||||
|
*/
|
||||||
|
return new->attrs->proto->proto > old->attrs->proto->proto;
|
||||||
|
}
|
||||||
if (better = new->attrs->proto->rte_better)
|
if (better = new->attrs->proto->rte_better)
|
||||||
return better(new, old);
|
return better(new, old);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user