mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 23:08:38 +00:00
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>
This commit is contained in:
parent
169edb7f12
commit
ae90dfbbb7
@ -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)
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user