From edf6d838a7bdee14b75bde57204d3cc5ceb7264c Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Tue, 18 May 2021 01:23:35 +0300 Subject: [PATCH] ospfd: fix "default-information originate" in non-existing vrf If the default route redistribution is configured in OSPF router before the VRF is created, then this is not currently registered in zebra after the VRF creation. Signed-off-by: Igor Ryzhov --- ospfd/ospfd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index cc1404e5e9..7505f24aef 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -2182,6 +2182,16 @@ static void ospf_set_redist_vrf_bitmaps(struct ospf *ospf, bool set) vrf_bitmap_unset(zclient->redist[AFI_IP][type], ospf->vrf_id); } + + red_list = ospf->redist[DEFAULT_ROUTE]; + if (red_list) { + if (set) + vrf_bitmap_set(zclient->default_information[AFI_IP], + ospf->vrf_id); + else + vrf_bitmap_unset(zclient->default_information[AFI_IP], + ospf->vrf_id); + } } /* Enable OSPF VRF instance */ -- 2.39.5