]> git.puffer.fish Git - mirror/frr.git/commitdiff
Revert "bgpd: vrf route leaking, fix vrf redistribute"
authorIgor Ryzhov <iryzhov@nfware.com>
Sun, 9 May 2021 19:28:36 +0000 (22:28 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Sun, 9 May 2021 19:28:36 +0000 (22:28 +0300)
This reverts commit 6b2433c63f7fd3027cea8e06ca45f85bd3eea6f2.

bgpd/bgp_zebra.c
zebra/redistribute.c

index 288c2851b37c43ec2dbb37991ec33bd8666f8a33..c300fc7b1c473b1fee2d046facbb2f734f7486d9 100644 (file)
@@ -1700,6 +1700,9 @@ int bgp_redistribute_set(struct bgp *bgp, afi_t afi, int type,
 
                redist_add_instance(&zclient->mi_redist[afi][type], instance);
        } else {
+               if (vrf_bitmap_check(zclient->redist[afi][type], bgp->vrf_id))
+                       return CMD_WARNING;
+
 #ifdef ENABLE_BGP_VNC
                if (EVPN_ENABLED(bgp) && type == ZEBRA_ROUTE_VNC_DIRECT) {
                        vnc_export_bgp_enable(
index 7cb426359d8e1c88100f6a1e1f90a0404925411f..89f46f9c97a030d61ea0bd43c8b253cc19775594 100644 (file)
@@ -337,12 +337,17 @@ void zebra_redistribute_add(ZAPI_HANDLER_ARGS)
                                           zvrf_id(zvrf), afi);
                }
        } else {
-               if (IS_ZEBRA_DEBUG_EVENT)
-                       zlog_debug("%s: setting vrf %s(%u) redist bitmap",
-                                  __func__, VRF_LOGNAME(zvrf->vrf),
-                                  zvrf_id(zvrf));
-               vrf_bitmap_set(client->redist[afi][type], zvrf_id(zvrf));
-               zebra_redistribute(client, type, 0, zvrf_id(zvrf), afi);
+               if (!vrf_bitmap_check(client->redist[afi][type],
+                                     zvrf_id(zvrf))) {
+                       if (IS_ZEBRA_DEBUG_EVENT)
+                               zlog_debug(
+                                       "%s: setting vrf %s(%u) redist bitmap",
+                                       __func__, VRF_LOGNAME(zvrf->vrf),
+                                       zvrf_id(zvrf));
+                       vrf_bitmap_set(client->redist[afi][type],
+                                      zvrf_id(zvrf));
+                       zebra_redistribute(client, type, 0, zvrf_id(zvrf), afi);
+               }
        }
 
 stream_failure: