From ee568318946ae5c567e483a9866a43c61fe737ad Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 2 Feb 2019 15:52:14 -0500 Subject: [PATCH] pimd: Pim is not respecting the move of an interface from old->new vrf PIM needed to be updated to move to the new vrf. Signed-off-by: Donald Sharp --- pimd/pim_zebra.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index b7111cf7bf..11ca6e8a10 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -267,6 +267,27 @@ static int pim_zebra_if_state_down(int command, struct zclient *zclient, return 0; } +static int pim_zebra_interface_vrf_update(int command, struct zclient *zclient, + zebra_size_t length, vrf_id_t vrf_id) +{ + struct interface *ifp; + vrf_id_t new_vrf_id; + + ifp = zebra_interface_vrf_update_read(zclient->ibuf, vrf_id, + &new_vrf_id); + if (!ifp) + return 0; + + if (PIM_DEBUG_ZEBRA) + zlog_debug("%s: %s updating from %u to %u", + __PRETTY_FUNCTION__, + ifp->name, vrf_id, new_vrf_id); + + if_update_to_new_vrf(ifp, new_vrf_id); + + return 0; +} + #ifdef PIM_DEBUG_IFADDR_DUMP static void dump_if_address(struct interface *ifp) { @@ -762,6 +783,7 @@ void pim_zebra_init(void) zclient->interface_down = pim_zebra_if_state_down; zclient->interface_address_add = pim_zebra_if_address_add; zclient->interface_address_delete = pim_zebra_if_address_del; + zclient->interface_vrf_update = pim_zebra_interface_vrf_update; zclient->nexthop_update = pim_parse_nexthop_update; zclient_init(zclient, ZEBRA_ROUTE_PIM, 0, &pimd_privs); -- 2.39.5