]> git.puffer.fish Git - mirror/frr.git/commit
zebra: Allow redistribution for routes selected 8620/head
authorDonald Sharp <sharpd@nvidia.com>
Mon, 3 May 2021 23:53:12 +0000 (19:53 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 3 May 2021 23:53:12 +0000 (19:53 -0400)
commitc3d0d6e8a131a2bf59553335565deda5fa9bf2e8
treeb3b718910b0ab71752f084f88d7b27b2d6d98c45
parent83187b82853d0bf905dacf4de93592f2207c35a6
zebra: Allow redistribution for routes selected

Current code has an inconsistent behavior with redistribute routes.
Suppose you have a kernel route that is being read w/ a distance
of 255:

eva# show ip route kernel
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.161.1, enp39s0, 00:06:39
K>* 4.4.4.4/32 [255/8192] via 192.168.161.1, enp39s0, 00:01:26
eva#

If you have redistribution already turned on for kernel routes
you will be notified of the 4.4.4.4/32 route.  If you turn
on kernel route redistribution watching after the 4.4.4.4/32 route
has been read by zebra you will never learn of it.

There is no need to look for infinite distance in the redistribution
code.  Either we are selected or not.  In other words non kernel routes
with an 255 distance are never installed so the checks were pointless.

So let's just remove the distance checking and tell interested parties
about the 255 kernel route if it exists.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/redistribute.c