summaryrefslogtreecommitdiff
path: root/pimd/pim_zebra.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-14 13:11:35 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 13:51:39 -0400
commit90133de64ca73c7dfcd2ed499be5544421c0ca96 (patch)
treeeaddc3fd49336ffcecd333b41c05c7b2cd8a684d /pimd/pim_zebra.c
parent2aa1ca8418689d078c69e008e65f8d6c25c016fa (diff)
pimd: Allow pim to work in vrf's without explicitly configuring the vrf device
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>
Diffstat (limited to 'pimd/pim_zebra.c')
-rw-r--r--pimd/pim_zebra.c17
1 files changed, 17 insertions, 0 deletions
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;
}