diff options
author | G. Paul Ziemba <paulz@labn.net> | 2018-02-28 09:01:13 +0100 |
---|---|---|
committer | Lou Berger <lberger@labn.net> | 2018-03-09 22:42:40 +0100 |
commit | 3d9f730216e49e10f44cbb7f2237e22bd8368834 (patch) | |
tree | eefadf84c8f0879bd4d5b007851e7d9729befcaf /ospfd | |
parent | ospfd: debug detail for redistribute (diff) | |
download | frr-3d9f730216e49e10f44cbb7f2237e22bd8368834.tar.xz frr-3d9f730216e49e10f44cbb7f2237e22bd8368834.zip |
ospfd: resend redistribute request to zebra after ospf gets notified of vrf_id
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospfd.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index c8a4dc12c..26bbc5ee1 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -2049,6 +2049,23 @@ static int ospf_vrf_delete(struct vrf *vrf) return 0; } +static void ospf_set_redist_vrf_bitmaps(struct ospf *ospf) +{ + int type; + struct list *red_list; + + for (type = 0; type < ZEBRA_ROUTE_MAX; type++) { + red_list = ospf->redist[type]; + if (!red_list) + continue; + if (IS_DEBUG_OSPF_EVENT) + zlog_debug( + "%s: setting redist vrf %d bitmap for type %d", + __func__, ospf->vrf_id, type); + vrf_bitmap_set(zclient->redist[AFI_IP][type], ospf->vrf_id); + } +} + /* Enable OSPF VRF instance */ static int ospf_vrf_enable(struct vrf *vrf) { @@ -2077,6 +2094,15 @@ static int ospf_vrf_enable(struct vrf *vrf) "ospf_sock_init: could not raise privs, %s", safe_strerror(errno)); } + + /* stop zebra redist to us for old vrf */ + zclient_send_dereg_requests(zclient, old_vrf_id); + + ospf_set_redist_vrf_bitmaps(ospf); + + /* start zebra redist to us for new vrf */ + ospf_zebra_vrf_register(ospf); + ret = ospf_sock_init(ospf); if (ospfd_privs.change(ZPRIVS_LOWER)) { zlog_err( @@ -2088,7 +2114,6 @@ static int ospf_vrf_enable(struct vrf *vrf) thread_add_read(master, ospf_read, ospf, ospf->fd, &ospf->t_read); ospf->oi_running = 1; - ospf_zebra_vrf_register(ospf); ospf_router_id_update(ospf); } } |