Merge pull request #16159 from opensourcerouting/fix/ignore_auto_created_vrf_bgp_instances

bgpd: Ignore auto created VRF BGP instances
This commit is contained in:
Donald Sharp 2024-06-05 09:51:09 -04:00 committed by GitHub
commit 2871a4e8cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3620,10 +3620,13 @@ struct bgp *bgp_lookup_by_name(const char *name)
struct bgp *bgp;
struct listnode *node, *nnode;
for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp))
for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp)) {
if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_AUTO))
continue;
if ((bgp->name == NULL && name == NULL)
|| (bgp->name && name && strcmp(bgp->name, name) == 0))
return bgp;
}
return NULL;
}