1 From 46093914a5f95f50c9aef088b7172d6774d204cb Mon Sep 17 00:00:00 2001
2 From: Oryon <pierre@darou.fr>
3 Date: Tue, 11 Mar 2014 16:03:58 +0100
4 Subject: [PATCH 2/2] Metric should be more important than distance at lookup
7 src/mrib.cpp | 10 +++++-----
8 1 file changed, 5 insertions(+), 5 deletions(-)
12 @@ -327,16 +327,16 @@ mrib_def::mrib_node *mrib_def::prefix_lo
13 void mrib_def::insert_prefix_in_node(mrib_node *n, prefix *p) {
14 prefix *curr = n->head, *prev = 0;
16 - /* first check the proper place based on distance */
17 - while (curr && curr->distance < p->distance) {
18 + /* first check the proper place based on metric */
19 + while (curr && curr->metric < p->metric) {
24 - if (prev && prev->distance == p->distance) {
25 - /* if distance matches, take metric into place */
26 + if (prev && prev->metric == p->metric) {
27 + /* if metric matches, take distance into place */
29 - while (curr && curr->metric <= p->metric) {
30 + while (curr && curr->distance <= p->distance) {