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.c49
1 files changed, 24 insertions, 25 deletions
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index aeaea7d69f..25ac307ac4 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -54,8 +54,7 @@ static struct zclient *zclient = NULL;
/* Router-id update message from zebra. */
-static int pim_router_id_update_zebra(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_router_id_update_zebra(ZAPI_CALLBACK_ARGS)
{
struct prefix router_id;
@@ -64,8 +63,7 @@ static int pim_router_id_update_zebra(int command, struct zclient *zclient,
return 0;
}
-static int pim_zebra_if_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_add(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct pim_instance *pim;
@@ -126,8 +124,7 @@ static int pim_zebra_if_add(int command, struct zclient *zclient,
return 0;
}
-static int pim_zebra_if_del(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_del(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
struct pim_instance *pim;
@@ -166,8 +163,7 @@ static int pim_zebra_if_del(int command, struct zclient *zclient,
return 0;
}
-static int pim_zebra_if_state_up(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_state_up(ZAPI_CALLBACK_ARGS)
{
struct pim_instance *pim;
struct interface *ifp;
@@ -235,8 +231,7 @@ static int pim_zebra_if_state_up(int command, struct zclient *zclient,
return 0;
}
-static int pim_zebra_if_state_down(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_state_down(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
@@ -280,8 +275,7 @@ 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)
+static int pim_zebra_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
vrf_id_t new_vrf_id;
@@ -326,8 +320,7 @@ static void dump_if_address(struct interface *ifp)
}
#endif
-static int pim_zebra_if_address_add(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_address_add(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
struct prefix *p;
@@ -342,7 +335,7 @@ static int pim_zebra_if_address_add(int command, struct zclient *zclient,
will add address to interface list by calling
connected_add_by_prefix()
*/
- c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (!c)
return 0;
@@ -406,8 +399,7 @@ static int pim_zebra_if_address_add(int command, struct zclient *zclient,
return 0;
}
-static int pim_zebra_if_address_del(int command, struct zclient *client,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_if_address_del(ZAPI_CALLBACK_ARGS)
{
struct connected *c;
struct prefix *p;
@@ -426,7 +418,7 @@ static int pim_zebra_if_address_del(int command, struct zclient *client,
will remove address from interface list by calling
connected_delete_by_prefix()
*/
- c = zebra_interface_address_read(command, client->ibuf, vrf_id);
+ c = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (!c)
return 0;
@@ -554,8 +546,7 @@ void pim_zebra_upstream_rpf_changed(struct pim_instance *pim,
pim_upstream_update_join_desired(pim, up);
}
-static int pim_zebra_vxlan_sg_proc(int command, struct zclient *zclient,
- zebra_size_t length, vrf_id_t vrf_id)
+static int pim_zebra_vxlan_sg_proc(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
struct pim_instance *pim;
@@ -577,11 +568,11 @@ static int pim_zebra_vxlan_sg_proc(int command, struct zclient *zclient,
pim_str_sg_set(&sg, sg_str);
zlog_debug("%u:recv SG %s %s", vrf_id,
- (command == ZEBRA_VXLAN_SG_ADD)?"add":"del",
+ (cmd == ZEBRA_VXLAN_SG_ADD)?"add":"del",
sg_str);
}
- if (command == ZEBRA_VXLAN_SG_ADD)
+ if (cmd == ZEBRA_VXLAN_SG_ADD)
pim_vxlan_sg_add(pim, &sg);
else
pim_vxlan_sg_del(pim, &sg);
@@ -789,7 +780,7 @@ void sched_rpf_cache_refresh(struct pim_instance *pim)
static void pim_zebra_connected(struct zclient *zclient)
{
/* Send the client registration */
- bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
+ bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER, router->vrf_id);
zclient_send_reg_requests(zclient, router->vrf_id);
}
@@ -1305,8 +1296,16 @@ void pim_forward_stop(struct pim_ifchannel *ch, bool install_it)
install_it, up->channel_oil->installed);
}
- pim_channel_del_oif(up->channel_oil, ch->interface,
- PIM_OIF_FLAG_PROTO_PIM);
+ /*
+ * If a channel is being removed, check to see if we still need
+ * to inherit the interface. If so make sure it is added in
+ */
+ if (pim_upstream_evaluate_join_desired_interface(up, ch, ch->parent))
+ pim_channel_add_oif(up->channel_oil, ch->interface,
+ PIM_OIF_FLAG_PROTO_PIM);
+ else
+ pim_channel_del_oif(up->channel_oil, ch->interface,
+ PIM_OIF_FLAG_PROTO_PIM);
if (install_it && !up->channel_oil->installed)
pim_mroute_add(up->channel_oil, __PRETTY_FUNCTION__);