bfdd: add the vrf update hook in case vrf name changes

in case vrf name changes, use a hook to be notified about the vrf
change.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2019-06-14 13:50:05 +02:00
parent e0f36c91e2
commit 43ba41c1a3

View File

@ -1630,6 +1630,16 @@ static int bfd_vrf_delete(struct vrf *vrf)
return 0;
}
static int bfd_vrf_update(struct vrf *vrf)
{
if (!vrf_is_enabled(vrf))
return 0;
log_debug("VRF update: %s(%u)", vrf->name, vrf->vrf_id);
/* a different name is given; update bfd list */
bfdd_sessions_enable_vrf(vrf);
return 0;
}
static int bfd_vrf_enable(struct vrf *vrf)
{
struct bfd_vrf_global *bvrf;
@ -1715,7 +1725,7 @@ static int bfd_vrf_disable(struct vrf *vrf)
void bfd_vrf_init(void)
{
vrf_init(bfd_vrf_new, bfd_vrf_enable, bfd_vrf_disable,
bfd_vrf_delete, NULL);
bfd_vrf_delete, bfd_vrf_update);
}
void bfd_vrf_terminate(void)