]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: track and compare distance of recursive nexthops
authorJorge Boncompte <jbonor@gmail.com>
Tue, 25 Jul 2017 10:17:50 +0000 (12:17 +0200)
committerJorge Boncompte <jbonor@gmail.com>
Fri, 4 Aug 2017 08:19:36 +0000 (10:19 +0200)
Fixes routing loops when backup routes with recursive nexthops of other
protocols come and go.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
zebra/zebra_rnh.c

index 8a326c27fc34a6475e7ec772d8d9392a9f2c3300..8ab46f683c7ebe75cdcbaa7e2c052c7ec5d40e27 100644 (file)
@@ -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;