summaryrefslogtreecommitdiffstats
path: root/pimd/pim_iface.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-14 19:11:35 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 19:51:39 +0200
commit90133de64ca73c7dfcd2ed499be5544421c0ca96 (patch)
treeeaddc3fd49336ffcecd333b41c05c7b2cd8a684d /pimd/pim_iface.c
parentpimd: When we are initializing a pim socket limit hellos (diff)
downloadfrr-90133de64ca73c7dfcd2ed499be5544421c0ca96.tar.xz
frr-90133de64ca73c7dfcd2ed499be5544421c0ca96.zip
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_iface.c')
-rw-r--r--pimd/pim_iface.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 19747ebcb..8628da2c8 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;
+}