Under vrf's pim needs to have a socket listening for pim packets on the vrf
device so that we can actually get the packets. As such when we configure
up a vrf interface, configure just enough to allow it to listen on the
device and to do the right thing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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;
+}
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 */
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;
}