Skip to content

Commit

Permalink
bfdd: add the vrf update hook in case vrf name changes
Browse files Browse the repository at this point in the history
in case vrf name changes, use a hook to be notified about the vrf
change.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
  • Loading branch information
pguibert6WIND committed Aug 27, 2019
1 parent e0f36c9 commit 43ba41c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bfdd/bfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 43ba41c

Please sign in to comment.