mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 11:30:30 +00:00
pimd: Don't assert when looking up a neighbor
Do not assert when looking up a neighbor, we don't know if we have a neighbor don't punish us. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
d4a2bc11ad
commit
6971955465
@ -392,7 +392,8 @@ struct pim_neighbor *pim_neighbor_find(struct interface *ifp,
|
|||||||
struct pim_neighbor *neigh;
|
struct pim_neighbor *neigh;
|
||||||
|
|
||||||
pim_ifp = ifp->info;
|
pim_ifp = ifp->info;
|
||||||
zassert(pim_ifp);
|
if (!pim_ifp)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_neighbor_list, node, neigh)) {
|
for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_neighbor_list, node, neigh)) {
|
||||||
if (source_addr.s_addr == neigh->source_addr.s_addr) {
|
if (source_addr.s_addr == neigh->source_addr.s_addr) {
|
||||||
@ -400,7 +401,7 @@ struct pim_neighbor *pim_neighbor_find(struct interface *ifp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -413,7 +414,7 @@ pim_neighbor_find_if (struct interface *ifp)
|
|||||||
{
|
{
|
||||||
struct pim_interface *pim_ifp = ifp->info;
|
struct pim_interface *pim_ifp = ifp->info;
|
||||||
|
|
||||||
if (pim_ifp->pim_neighbor_list->count != 1)
|
if (!pim_ifp || pim_ifp->pim_neighbor_list->count != 1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return listnode_head (pim_ifp->pim_neighbor_list);
|
return listnode_head (pim_ifp->pim_neighbor_list);
|
||||||
|
Loading…
Reference in New Issue
Block a user