summaryrefslogtreecommitdiff
path: root/nest/rt-table.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 17:18:03 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 17:18:03 +0200
commit1a92ee9d4df265018c0344064019f53bc3afce3a (patch)
tree3eb67d0604086b399618bc525a83ce83deac9eb0 /nest/rt-table.c
parent674587d9c84ed70151abc56003c371668079ae31 (diff)
parent337c04c45e1472d6d9b531a3c55f1f2d30ebf308 (diff)
Merge commit '337c04c45e1472d6d9b531a3c55f1f2d30ebf308' into haugesund
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index d89c087d..e0c475b7 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -634,9 +634,12 @@ rte_better(rte *new, rte *old)
if (!rte_is_valid(new))
return 0;
- if (new->attrs->pref > old->attrs->pref)
+ u32 np = rt_get_preference(new);
+ u32 op = rt_get_preference(old);
+
+ if (np > op)
return 1;
- if (new->attrs->pref < old->attrs->pref)
+ if (np < op)
return 0;
if (new->src->proto->proto != old->src->proto->proto)
{
@@ -660,7 +663,7 @@ rte_mergable(rte *pri, rte *sec)
if (!rte_is_valid(pri) || !rte_is_valid(sec))
return 0;
- if (pri->attrs->pref != sec->attrs->pref)
+ if (rt_get_preference(pri) != rt_get_preference(sec))
return 0;
if (pri->src->proto->proto != sec->src->proto->proto)