]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Ensure that we have a ifp pointer
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 30 Apr 2020 15:16:28 +0000 (11:16 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 30 Apr 2020 15:16:28 +0000 (11:16 -0400)
It is possible that the if_lookup_by_index() call will return
a NULL value and calling zclient_send_interface_radv_req.  Just
test that we have a valid interface pointer.

Found by Coverity

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_nht.c

index cc208a8190efe0b5fc7ce541872bbe5d79c14a0d..fced2fbcab9771fb0804be4e01050f8f21a5ffd3 100644 (file)
@@ -962,6 +962,9 @@ void bgp_nht_dereg_enhe_cap_intfs(struct peer *peer)
        for (nhop = bnc->nexthop; nhop; nhop = nhop->next) {
                ifp = if_lookup_by_index(nhop->ifindex, nhop->vrf_id);
 
+               if (!ifp)
+                       continue;
+
                zclient_send_interface_radv_req(zclient, nhop->vrf_id, ifp, 0,
                                                0);
        }