summaryrefslogtreecommitdiff
path: root/pimd/pim_iface.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetwroks.com>2016-06-23 11:46:57 -0400
committerDonald Sharp <sharpd@cumulusnetwroks.com>2016-06-23 11:46:57 -0400
commitae90dfbbb7221ba3863e52c1b2f4789de1b090a3 (patch)
treeeafbd5b32dc2e119d35c0356a98b009afccb16b3 /pimd/pim_iface.c
parent169edb7f12147a0c0505f6cd8d4bf4ccd535afba (diff)
pimd: Handle pimreg a bit better
The pimreg device is vif_index == 0. Allow it to be used. 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, 12 insertions, 1 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 87c25c0dbd..1dfbd9990a 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -772,6 +772,9 @@ struct interface *pim_if_find_by_vif_index(int vif_index)
struct listnode *ifnode;
struct interface *ifp;
+ if (vif_index == 0)
+ return if_lookup_by_name_vrf ("pimreg", VRF_DEFAULT);
+
for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), ifnode, ifp)) {
if (ifp->info) {
struct pim_interface *pim_ifp;
@@ -789,7 +792,15 @@ struct interface *pim_if_find_by_vif_index(int vif_index)
*/
int pim_if_find_vifindex_by_ifindex(int ifindex)
{
- return ifindex;
+ struct pim_interface *pim_ifp;
+ struct interface *ifp;
+
+ ifp = if_lookup_by_index_vrf (ifindex, VRF_DEFAULT);
+ pim_ifp = ifp->info;
+ if (!pim_ifp)
+ return -1;
+
+ return pim_ifp->mroute_vif_index;
}
int pim_if_lan_delay_enabled(struct interface *ifp)