summaryrefslogtreecommitdiff
path: root/pimd/pim_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_zebra.c')
-rw-r--r--pimd/pim_zebra.c46
1 files changed, 41 insertions, 5 deletions
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index 3dfc36a0c2..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)
{
@@ -727,11 +748,11 @@ void sched_rpf_cache_refresh(struct pim_instance *pim)
if (PIM_DEBUG_ZEBRA) {
zlog_debug("%s: triggering %ld msec timer", __PRETTY_FUNCTION__,
- qpim_rpf_cache_refresh_delay_msec);
+ router->rpf_cache_refresh_delay_msec);
}
- thread_add_timer_msec(master, on_rpf_cache_refresh, pim,
- qpim_rpf_cache_refresh_delay_msec,
+ thread_add_timer_msec(router->master, on_rpf_cache_refresh, pim,
+ router->rpf_cache_refresh_delay_msec,
&pim->rpf_cache_refresher);
}
@@ -740,14 +761,20 @@ static void pim_zebra_connected(struct zclient *zclient)
/* Send the client registration */
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
- zclient_send_reg_requests(zclient, pimg->vrf_id);
+ zclient_send_reg_requests(zclient, router->vrf_id);
+}
+
+static void pim_zebra_capabilities(struct zclient_capabilities *cap)
+{
+ router->role = cap->role;
}
void pim_zebra_init(void)
{
/* Socket for receiving updates from Zebra daemon */
- zclient = zclient_new(master, &zclient_options_default);
+ zclient = zclient_new(router->master, &zclient_options_default);
+ zclient->zebra_capabilities = pim_zebra_capabilities;
zclient->zebra_connected = pim_zebra_connected;
zclient->router_id_update = pim_router_id_update_zebra;
zclient->interface_add = pim_zebra_if_add;
@@ -756,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);
@@ -1048,6 +1076,10 @@ void igmp_source_forward_start(struct pim_instance *pim,
__PRETTY_FUNCTION__,
pim_str_sg_dump(&sg),
group->group_igmp_sock->interface->name);
+
+ pim_channel_del_oif(source->source_channel_oil,
+ group->group_igmp_sock->interface,
+ PIM_OIF_FLAG_PROTO_IGMP);
return;
}
/*
@@ -1059,6 +1091,10 @@ void igmp_source_forward_start(struct pim_instance *pim,
if (PIM_DEBUG_MROUTE)
zlog_warn("%s: Failure to add local membership for %s",
__PRETTY_FUNCTION__, pim_str_sg_dump(&sg));
+
+ pim_channel_del_oif(source->source_channel_oil,
+ group->group_igmp_sock->interface,
+ PIM_OIF_FLAG_PROTO_IGMP);
return;
}