diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2025-02-14 18:01:00 +0100 | 
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2025-02-14 18:08:53 +0100 | 
| commit | d9d74d33bca0e23a2cd4723fbc4709dc83fd1332 (patch) | |
| tree | 183441f2d98db61824f02b3508131619d94bcd47 /bgpd | |
| parent | a2c1956efa399c6770605712d0b53e5f24979acc (diff) | |
Revert "bgpd: fix bgp vrf instance creation from implicit"
This reverts commit 2ff08af78e315c69795417d150cd23649f68c655.
The fix is obviously wrong.
Link: 2ff08af78e315c69795417d150cd23649f68c655
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'bgpd')
| -rw-r--r-- | bgpd/bgpd.c | 23 | 
1 files changed, 11 insertions, 12 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index edda82b63c..8a3ae538dc 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3410,6 +3410,17 @@ 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) @@ -3453,18 +3464,6 @@ 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");  | 
