summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_iface.c13
-rw-r--r--pimd/pim_iface.h2
-rw-r--r--pimd/pim_zebra.c17
3 files changed, 32 insertions, 0 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 19747ebcb3..8628da2c8d 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -1593,3 +1593,16 @@ int pim_if_is_loopback(struct pim_instance *pim, struct interface *ifp)
return 0;
}
+
+int pim_if_is_vrf_device(struct interface *ifp)
+{
+ struct vrf *vrf;
+
+ RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
+ {
+ if (strncmp(ifp->name, vrf->name, strlen(ifp->name)) == 0)
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/pimd/pim_iface.h b/pimd/pim_iface.h
index 7eff299023..963d41fc3e 100644
--- a/pimd/pim_iface.h
+++ b/pimd/pim_iface.h
@@ -206,4 +206,6 @@ int pim_if_connected_to_source(struct interface *ifp, struct in_addr src);
int pim_update_source_set(struct interface *ifp, struct in_addr source);
int pim_if_is_loopback(struct pim_instance *pim, struct interface *ifp);
+
+int pim_if_is_vrf_device(struct interface *ifp);
#endif /* PIM_IFACE_H */
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index 8c0715101b..7fc7e42534 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -89,6 +89,23 @@ static int pim_zebra_if_add(int command, struct zclient *zclient,
if (if_is_operative(ifp))
pim_if_addr_add_all(ifp);
+ /*
+ * If we are a vrf device that is up, open up the pim_socket for
+ * listening
+ * to incoming pim messages irrelevant if the user has configured us
+ * for pim or not.
+ */
+ if (pim_if_is_vrf_device(ifp)) {
+ struct pim_interface *pim_ifp;
+
+ if (!ifp->info) {
+ pim_ifp = pim_if_new(ifp, 0, 0);
+ ifp->info = pim_ifp;
+ }
+
+ pim_sock_add(ifp);
+ }
+
return 0;
}