diff options
| author | Donald Sharp <sharpd@cumulusnetwroks.com> | 2016-06-23 11:46:57 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetwroks.com> | 2016-06-23 11:46:57 -0400 |
| commit | ae90dfbbb7221ba3863e52c1b2f4789de1b090a3 (patch) | |
| tree | eafbd5b32dc2e119d35c0356a98b009afccb16b3 | |
| parent | 169edb7f12147a0c0505f6cd8d4bf4ccd535afba (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>
| -rw-r--r-- | pimd/pim_iface.c | 13 | ||||
| -rw-r--r-- | pimd/pim_zebra.c | 2 |
2 files changed, 13 insertions, 2 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) diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index f4f1b47263..e947ff87c5 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -779,7 +779,7 @@ static int fib_lookup_if_vif_index(struct in_addr addr) vif_index = pim_if_find_vifindex_by_ifindex(first_ifindex); - if (vif_index < 1) { + if (vif_index < 0) { char addr_str[100]; pim_inet4_dump("<addr?>", addr, addr_str, sizeof(addr_str)); zlog_warn("%s %s: low vif_index=%d < 1 nexthop for address %s", |
