bgpd: ignore the wrong interface for nht procedure

`bnc->ifindex` should not be with 0 ( IFINDEX_INTERNAL ), so we can ignore
the wrong interface to make it safe.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
This commit is contained in:
anlan_cs 2023-06-05 16:23:16 +08:00
parent a99521a26f
commit 871d78e90f

View File

@ -714,6 +714,11 @@ static void bgp_nht_ifp_table_handle(struct bgp *bgp,
{
struct bgp_nexthop_cache *bnc;
if (ifp->ifindex == IFINDEX_INTERNAL) {
zlog_warn("%s: The interface %s ignored", __func__, ifp->name);
return;
}
frr_each (bgp_nexthop_cache, table, bnc) {
if (bnc->ifindex != ifp->ifindex)
continue;