]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: ignore the wrong interface for nht procedure 13575/head
authoranlan_cs <vic.lan@pica8.com>
Mon, 5 Jun 2023 08:23:16 +0000 (16:23 +0800)
committeranlan_cs <vic.lan@pica8.com>
Thu, 13 Jul 2023 07:51:08 +0000 (15:51 +0800)
`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>
bgpd/bgp_nht.c

index a46616803c10cc06df5f2ab5a248bc74cf0f7dac..5a511eac1c2ded7e66cbc5ab59d42e8235a076e8 100644 (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;