mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 00:25:01 +00:00
pimd: if_lookup_by_index can fail handle it appropriately
It is possible that a if_lookup_by_index can return NULL ensure that we handle this appropriately. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
50cf5243c1
commit
85948e7bfa
@ -788,6 +788,10 @@ int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS)
|
|||||||
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
||||||
ifp1 = if_lookup_by_index(nexthop->ifindex,
|
ifp1 = if_lookup_by_index(nexthop->ifindex,
|
||||||
pim->vrf_id);
|
pim->vrf_id);
|
||||||
|
|
||||||
|
if (!ifp1)
|
||||||
|
nbr = NULL;
|
||||||
|
else
|
||||||
nbr = pim_neighbor_find_if(ifp1);
|
nbr = pim_neighbor_find_if(ifp1);
|
||||||
/* Overwrite with Nbr address as NH addr */
|
/* Overwrite with Nbr address as NH addr */
|
||||||
if (nbr)
|
if (nbr)
|
||||||
|
@ -285,17 +285,17 @@ static int zclient_read_nexthop(struct pim_instance *pim,
|
|||||||
* If we are sending v6 secondary assume we receive v6
|
* If we are sending v6 secondary assume we receive v6
|
||||||
* secondary
|
* secondary
|
||||||
*/
|
*/
|
||||||
if (pim->send_v6_secondary)
|
struct interface *ifp = if_lookup_by_index(
|
||||||
nbr = pim_neighbor_find_by_secondary(
|
|
||||||
if_lookup_by_index(
|
|
||||||
nexthop_tab[num_ifindex]
|
|
||||||
.ifindex,
|
|
||||||
nexthop_vrf_id),
|
|
||||||
&p);
|
|
||||||
else
|
|
||||||
nbr = pim_neighbor_find_if(if_lookup_by_index(
|
|
||||||
nexthop_tab[num_ifindex].ifindex,
|
nexthop_tab[num_ifindex].ifindex,
|
||||||
nexthop_vrf_id));
|
nexthop_vrf_id);
|
||||||
|
|
||||||
|
if (!ifp)
|
||||||
|
nbr = NULL;
|
||||||
|
else if (pim->send_v6_secondary)
|
||||||
|
nbr = pim_neighbor_find_by_secondary(ifp, &p);
|
||||||
|
else
|
||||||
|
nbr = pim_neighbor_find_if(ifp);
|
||||||
|
|
||||||
if (nbr) {
|
if (nbr) {
|
||||||
nexthop_tab[num_ifindex].nexthop_addr.family =
|
nexthop_tab[num_ifindex].nexthop_addr.family =
|
||||||
AF_INET;
|
AF_INET;
|
||||||
|
Loading…
Reference in New Issue
Block a user