summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Slice <dslice@cumulusnetworks.com>2018-01-10 19:40:45 +0000
committerDon Slice <dslice@cumulusnetworks.com>2018-01-10 19:54:21 +0000
commit48c74f88259c8f706035d6fc80765f4a6f6594f7 (patch)
treec8a0bdcd3d957b9ef5b37af18c3d43fa147fa104
parentd1df0eedc322631b32009acc493fa0b746a8e0a9 (diff)
bgpd: fix updating redist bitmask when vrf_id changes
Problem reported that when "systemctl restart networking" was performed, prefixes previously redistributed into bgp from connected were deleted from the bgp table. Determined that we were not correctly changing the redistribution bitmask when the vrf_id of the vrf was changed. This patch corrects that behavior. Manual tests look good. bgp-min and vrf-min completed with no new failures. Ticket: CM-19369 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_zebra.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 1cf04abfce..b2db54ef79 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -1516,8 +1516,9 @@ void bgp_update_redist_vrf_bitmaps(struct bgp *bgp, vrf_id_t old_vrf_id)
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
- if (vrf_bitmap_check(zclient->redist[afi][i],
- old_vrf_id)) {
+ if ((old_vrf_id == VRF_UNKNOWN)
+ || vrf_bitmap_check(zclient->redist[afi][i],
+ old_vrf_id)) {
vrf_bitmap_unset(zclient->redist[afi][i],
old_vrf_id);
vrf_bitmap_set(zclient->redist[afi][i],