summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_rnh.c
diff options
context:
space:
mode:
authorJorge Boncompte <jbonor@gmail.com>2017-07-25 12:17:50 +0200
committerJorge Boncompte <jbonor@gmail.com>2017-08-04 10:19:36 +0200
commit7733c6c4190603a2ec156c917ae07b1b89554569 (patch)
treef48d4c6a0bd664ccbea25e7ce457b304d7f8bbdc /zebra/zebra_rnh.c
parentzebra: add missing protocols names to source-protocol route-map match (diff)
downloadfrr-7733c6c4190603a2ec156c917ae07b1b89554569.tar.xz
frr-7733c6c4190603a2ec156c917ae07b1b89554569.zip
zebra: track and compare distance of recursive nexthops
Fixes routing loops when backup routes with recursive nexthops of other protocols come and go. Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
Diffstat (limited to '')
-rw-r--r--zebra/zebra_rnh.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index 8a326c27f..8ab46f683 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -815,6 +815,7 @@ static void copy_state(struct rnh *rnh, struct route_entry *re,
state = XCALLOC(MTYPE_RE, sizeof(struct route_entry));
state->type = re->type;
+ state->distance = re->distance;
state->metric = re->metric;
route_entry_copy_nexthops(state, re->nexthop);
@@ -830,6 +831,9 @@ static int compare_state(struct route_entry *r1, struct route_entry *r2)
if ((!r1 && r2) || (r1 && !r2))
return 1;
+ if (r1->distance != r2->distance)
+ return 1;
+
if (r1->metric != r2->metric)
return 1;