]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: skip link-local routes when iterating over the RIB using the NB
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 19 May 2020 02:16:25 +0000 (23:16 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Sat, 16 May 2020 02:47:43 +0000 (23:47 -0300)
The motivation for this change is that IPv6 link-local routes don't
conform to the zebra YANG module since they all have the same prefix
(fe80::/64), but zebra's YANG module require each route to have
an unique prefix (the key of the "rib" list). This violation can
cause problems when iterating over the RIB asynchronously, so skip
those routes.

At the end of the day nobody cares about link-local routes anyway :)

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

index a09ac85682149955d620ef269d9e77935da3bf56..e1c06819faf8d71c1831cef4a30a1eec6c0b8b1a 100644 (file)
@@ -228,6 +228,11 @@ lib_vrf_zebra_ribs_rib_route_get_next(struct nb_cb_get_next_args *args)
        else
                rn = srcdest_route_next((struct route_node *)rn);
 
+       /* Skip link-local routes. */
+       if (rn && rn->p.family == AF_INET6
+           && IN6_IS_ADDR_LINKLOCAL(&rn->p.u.prefix6))
+               return NULL;
+
        return rn;
 }