diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-04-30 11:16:28 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-04-30 11:16:28 -0400 |
| commit | 68cecc3b69af13cda334e5bf0acb60d01e9f7ddc (patch) | |
| tree | 0aa7877cfe8b2aefa980059da3536ceb88fdf70c | |
| parent | ba3f5f06d024c3874c70b249ebe0aae82d5f63d9 (diff) | |
bgpd: Ensure that we have a ifp pointer
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>
| -rw-r--r-- | bgpd/bgp_nht.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index cc208a8190..fced2fbcab 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -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); } |
