summaryrefslogtreecommitdiffstats
path: root/zebra/redistribute.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-01-04 12:57:53 +0100
committerDonald Sharp <sharpd@nvidia.com>2022-01-18 14:39:40 +0100
commitdeb39cca21a1e74195199f710c0c8743ce07d847 (patch)
tree2d6ce8c00bc1ac3d6a8db4cdd19db4054a908d14 /zebra/redistribute.c
parentospfd: Get `default-information originate` working for ospf instances (diff)
downloadfrr-deb39cca21a1e74195199f710c0c8743ce07d847.tar.xz
frr-deb39cca21a1e74195199f710c0c8743ce07d847.zip
zebra: Do not allow instance redistribution to happen no matter what
If you have this setup: router ospf 3 redistribute sharp ! and then install: sharp install route 4.5.6.7 nexthop 192.168.100.1 1 sharp install route 4.5.6.8 nexthop 192.168.100.1 1 instance 3 sharp install route 4.5.6.9 nexthop 192.168.100.1 1 instance 4 The .8 and .9 routes are auto redistributed into ospf instance 3: eva# show ip ospf data OSPF Instance: 3 OSPF Router with ID (192.168.122.1) AS External Link States Link ID ADV Router Age Seq# CkSum Route 4.5.6.7 192.168.122.1 13 0x80000001 0x477c E2 4.5.6.7/32 [0x0] 4.5.6.8 192.168.122.1 5 0x80000001 0x3d85 E2 4.5.6.8/32 [0x0] 4.5.6.9 192.168.122.1 5 0x80000001 0x338e E2 4.5.6.9/32 [0x0] This cannot be correct behavior. When redistributing in the absense of an instance number the default instance of 0 should be used and should be the only route redistributed. Here is the correct behavior: eva# show ip route 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.119.1, enp39s0, 00:00:28 D>* 4.5.6.7/32 [150/0] via 192.168.100.1, virbr1, weight 1, 00:00:02 D[3]>* 4.5.6.8/32 [150/0] via 192.168.100.1, virbr1, weight 1, 00:00:02 D[4]>* 4.5.6.9/32 [150/0] via 192.168.100.1, virbr1, weight 1, 00:00:02 C>* 192.168.100.0/24 is directly connected, virbr1, 00:00:28 C>* 192.168.110.0/24 is directly connected, virbr2, 00:00:28 C>* 192.168.119.0/24 is directly connected, enp39s0, 00:00:28 C>* 192.168.122.0/24 is directly connected, virbr0, 00:00:28 eva# show ip ospf data OSPF Instance: 3 OSPF Router with ID (192.168.122.1) AS External Link States Link ID ADV Router Age Seq# CkSum Route 4.5.6.7 192.168.122.1 6 0x80000001 0x477c E2 4.5.6.7/32 [0x0] Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/redistribute.c')
-rw-r--r--zebra/redistribute.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index e7044bc67..b1e8815ce 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -176,10 +176,13 @@ static bool zebra_redistribute_check(const struct route_entry *re,
* If multi-instance then check for route
* redistribution for given instance.
*/
- if (re->instance
- && redist_check_instance(&client->mi_redist[afi][re->type],
- re->instance))
- return true;
+ if (re->instance) {
+ if (redist_check_instance(&client->mi_redist[afi][re->type],
+ re->instance))
+ return true;
+ else
+ return false;
+ }
/* If redistribution is enabled for give route type. */
if (vrf_bitmap_check(client->redist[afi][re->type], re->vrf_id))