diff options
author | Maria Matejka <mq@ucw.cz> | 2022-04-20 12:24:26 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-04 15:39:21 +0200 |
commit | 337c04c45e1472d6d9b531a3c55f1f2d30ebf308 (patch) | |
tree | 7526f6f33a6a57404ed9b15588b1a3fc3eb40182 /nest/rt-table.c | |
parent | d8661a4397e4576ac404661b192dd99d928e7890 (diff) |
Moved route preference to eattrs
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r-- | nest/rt-table.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c index 01194e02..919576bd 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -652,9 +652,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) { @@ -678,7 +681,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) |