summaryrefslogtreecommitdiff
path: root/pimd/pim_zebra.c
diff options
context:
space:
mode:
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2019-03-21 08:49:09 -0700
committerAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2019-04-20 08:33:21 -0700
commitaf7b561b9f5e9769fdda93b4a5ebd7a350c971a7 (patch)
treeb01df61e91025fda29f4dbac8a349b9b70c3a610 /pimd/pim_zebra.c
parentb583b035822bc0d1694a73edfcaa1aaef1387fe8 (diff)
pimd: handle VxLAN SG notifications from zebra
zebra sends (S, G) and (*, G) entries for BUM mcast groups to pimd. This commit includes the changes to handle the notifications and trigger the creation of (S, G) base cache in pimd. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_zebra.c')
-rw-r--r--pimd/pim_zebra.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index b20f31082d..552bda2e77 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -45,6 +45,7 @@
#include "pim_jp_agg.h"
#include "pim_nht.h"
#include "pim_ssm.h"
+#include "pim_vxlan.h"
#undef PIM_DEBUG_IFADDR_DUMP
#define PIM_DEBUG_IFADDR_DUMP
@@ -543,6 +544,41 @@ 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)
+{
+ struct stream *s;
+ struct pim_instance *pim;
+ struct prefix_sg sg;
+
+ pim = pim_get_pim_instance(vrf_id);
+ if (!pim)
+ return 0;
+
+ s = zclient->ibuf;
+
+ sg.family = AF_INET;
+ sg.prefixlen = stream_getl(s);
+ stream_get(&sg.src.s_addr, s, sg.prefixlen);
+ stream_get(&sg.grp.s_addr, s, sg.prefixlen);
+
+ if (PIM_DEBUG_ZEBRA) {
+ char sg_str[PIM_SG_LEN];
+
+ pim_str_sg_set(&sg, sg_str);
+ zlog_debug("%u:recv SG %s %s", vrf_id,
+ (command == ZEBRA_VXLAN_SG_ADD)?"add":"del",
+ sg_str);
+ }
+
+ if (command == ZEBRA_VXLAN_SG_ADD)
+ pim_vxlan_sg_add(pim, &sg);
+ else
+ pim_vxlan_sg_del(pim, &sg);
+
+ return 0;
+}
+
void pim_scan_individual_oil(struct channel_oil *c_oil, int in_vif_index)
{
struct in_addr vif_source;
@@ -769,6 +805,8 @@ void pim_zebra_init(void)
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->vxlan_sg_add = pim_zebra_vxlan_sg_proc;
+ zclient->vxlan_sg_del = pim_zebra_vxlan_sg_proc;
zclient_init(zclient, ZEBRA_ROUTE_PIM, 0, &pimd_privs);
if (PIM_DEBUG_PIM_TRACE) {