diff options
| author | Russ White <russ@riw.us> | 2025-02-11 12:28:52 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-11 12:28:52 -0500 |
| commit | 9348831b3cebee11cb9ae125f3e7038a816c31f6 (patch) | |
| tree | 4e2f48fca9cc152682f68a62729e21f1b366083d | |
| parent | 623f5f42a5a133130b1ea340bbcff108289c98e8 (diff) | |
| parent | 951a14ec86128d9d45995364ac447c60f2e8c08e (diff) | |
Merge pull request #18100 from FRRouting/mergify/bp/stable/10.2/pr-18081
bgpd: fix bgp vrf instance creation from implicit (backport #18081)
| -rw-r--r-- | bgpd/bgpd.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index e97bdb3d51..0601400afd 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3444,17 +3444,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) @@ -3498,6 +3487,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"); |
