summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2025-02-24 17:17:09 -0600
committerJafar Al-Gharaibeh <jafar@atcorp.com>2025-02-25 08:57:57 -0600
commit21ffe63d1d3a89746887387b568921f66f759240 (patch)
treed7907b132633862fef58be89b963fafec278564b
parent4156757e4089debb119a590e6dc65d5233f14ed7 (diff)
Revert "bgpd: update AS value of a hidden bgp instance"
This reverts commit 8e04277fff9597412198da123250e1951bfc580d. Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
-rw-r--r--bgpd/bgpd.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index d90875b78c..8a3ae538dc 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -3404,15 +3404,13 @@ static struct bgp *bgp_create(as_t *as, const char *name,
afi_t afi;
safi_t safi;
- if (hidden)
+ if (hidden) {
bgp = bgp_old;
- else
- bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp));
+ goto peer_init;
+ }
+ bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp));
bgp->as = *as;
-
- if (bgp->as_pretty)
- XFREE(MTYPE_BGP_NAME, bgp->as_pretty);
if (as_pretty)
bgp->as_pretty = XSTRDUP(MTYPE_BGP_NAME, as_pretty);
else
@@ -3424,9 +3422,6 @@ static struct bgp *bgp_create(as_t *as, const char *name,
} else
asn_str2asn_notation(bgp->as_pretty, NULL, &bgp->asnotation);
- if (hidden)
- goto peer_init;
-
if (BGP_DEBUG(zebra, ZEBRA)) {
if (inst_type == BGP_INSTANCE_TYPE_DEFAULT)
zlog_debug("Creating Default VRF, AS %s",