summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2025-02-24 17:17:10 -0600
committerJafar Al-Gharaibeh <jafar@atcorp.com>2025-02-25 08:58:14 -0600
commitbc6c7f60dcbf14d74ed5164e34fd3a6adc35495c (patch)
tree6d4d86f93fdf164a24d4017c9f7c9ce47dd02ddd /bgpd
parent21ffe63d1d3a89746887387b568921f66f759240 (diff)
Reapply "bgpd: fix bgp vrf instance creation from implicit"
This reverts commit d9d74d33bca0e23a2cd4723fbc4709dc83fd1332. Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgpd.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 8a3ae538dc..edda82b63c 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -3410,17 +3410,6 @@ static struct bgp *bgp_create(as_t *as, const char *name,
}
bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp));
- bgp->as = *as;
- if (as_pretty)
- bgp->as_pretty = XSTRDUP(MTYPE_BGP_NAME, as_pretty);
- else
- bgp->as_pretty = XSTRDUP(MTYPE_BGP_NAME, asn_asn2asplain(*as));
-
- if (asnotation != ASNOTATION_UNDEFINED) {
- bgp->asnotation = asnotation;
- SET_FLAG(bgp->config, BGP_CONFIG_ASNOTATION);
- } else
- asn_str2asn_notation(bgp->as_pretty, NULL, &bgp->asnotation);
if (BGP_DEBUG(zebra, ZEBRA)) {
if (inst_type == BGP_INSTANCE_TYPE_DEFAULT)
@@ -3464,6 +3453,18 @@ static struct bgp *bgp_create(as_t *as, const char *name,
bgp->peer = list_new();
peer_init:
+ bgp->as = *as;
+ if (as_pretty)
+ bgp->as_pretty = XSTRDUP(MTYPE_BGP_NAME, as_pretty);
+ else
+ bgp->as_pretty = XSTRDUP(MTYPE_BGP_NAME, asn_asn2asplain(*as));
+
+ if (asnotation != ASNOTATION_UNDEFINED) {
+ bgp->asnotation = asnotation;
+ SET_FLAG(bgp->config, BGP_CONFIG_ASNOTATION);
+ } else
+ asn_str2asn_notation(bgp->as_pretty, NULL, &bgp->asnotation);
+
bgp->peer->cmp = (int (*)(void *, void *))peer_cmp;
bgp->peerhash = hash_create(peer_hash_key_make, peer_hash_same,
"BGP Peer Hash");