summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2025-02-06 11:09:49 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2025-02-06 11:09:49 +0200
commit59d7a554e0abc3dc995366d93e42147eecb342b0 (patch)
treee6c9a745495e12ad1aa62bd3bb1182fdf8060f04
parent1d1c6c42404544cdc05a771b3e9e6eb6f14f4e46 (diff)
Revert "bgpd: fix duplicate BGP instance created with unified config"
This reverts commit aba588dd09aa098a88ba1355798c0e784e91ebc8.
-rw-r--r--bgpd/bgpd.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 34c0eab089..a984c5af87 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -3623,13 +3623,13 @@ struct bgp *bgp_lookup(as_t as, const char *name)
}
/* Lookup BGP structure by view name. */
-static struct bgp *bgp_lookup_by_name_filter(const char *name, bool filter_auto)
+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)) {
- if (filter_auto && CHECK_FLAG(bgp->vrf_flags, BGP_VRF_AUTO))
+ if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_AUTO))
continue;
if ((bgp->name == NULL && name == NULL)
|| (bgp->name && name && strcmp(bgp->name, name) == 0))
@@ -3638,11 +3638,6 @@ static struct bgp *bgp_lookup_by_name_filter(const char *name, bool filter_auto)
return NULL;
}
-struct bgp *bgp_lookup_by_name(const char *name)
-{
- return bgp_lookup_by_name_filter(name, true);
-}
-
/* Lookup BGP instance based on VRF id. */
/* Note: Only to be used for incoming messages from Zebra. */
struct bgp *bgp_lookup_by_vrf_id(vrf_id_t vrf_id)
@@ -3735,7 +3730,7 @@ int bgp_lookup_by_as_name_type(struct bgp **bgp_val, as_t *as, const char *name,
/* Multiple instance check. */
if (name)
- bgp = bgp_lookup_by_name_filter(name, false);
+ bgp = bgp_lookup_by_name(name);
else
bgp = bgp_get_default();