]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: add an exception for link-local connected routes 1090/head
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 1 Sep 2017 14:44:22 +0000 (11:44 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 1 Sep 2017 14:44:22 +0000 (11:44 -0300)
Link-local routes are unique in the sense that they all have the same
prefix but have different nexthops (local interfaces). Add an exception
in rib_add() to allows us to keep track of all of them.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
zebra/zebra_rib.c

index 59b693435d278a29f79aa5b5e49c5784faf69efe..deb434bd350fc1fe8f7d621c735374e4e1bdc297 100644 (file)
@@ -2472,7 +2472,12 @@ int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, u_short instance,
                rtnh = re->nexthop;
                if (nexthop_same_no_recurse(rtnh, nh))
                        return 0;
-               else
+               /*
+                * Nexthop is different. Remove the old route unless it's
+                * a link-local route.
+                */
+               else if (afi != AFI_IP6
+                        || !IN6_IS_ADDR_LINKLOCAL(&p->u.prefix6))
                        same = re;
        }