Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "bgpd: fix default instance when leaving the hidden state (backport 10.3)" #18162 #18255

Merged
merged 6 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 22 additions & 25 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3404,28 +3404,12 @@ 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));

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
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 (hidden)
goto peer_init;
}

bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp));

if (BGP_DEBUG(zebra, ZEBRA)) {
if (inst_type == BGP_INSTANCE_TYPE_DEFAULT)
Expand Down Expand Up @@ -3469,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");
Expand Down Expand Up @@ -3565,7 +3561,7 @@ static struct bgp *bgp_create(as_t *as, const char *name,
/* printable name we can use in debug messages */
if (inst_type == BGP_INSTANCE_TYPE_DEFAULT && !hidden) {
bgp->name_pretty = XSTRDUP(MTYPE_BGP_NAME, "VRF default");
} else if (!hidden) {
} else {
const char *n;
int len;

Expand Down Expand Up @@ -4261,11 +4257,12 @@ int bgp_delete(struct bgp *bgp)
bgp_set_evpn(bgp_get_default());
}

if (!IS_BGP_INSTANCE_HIDDEN(bgp)) {
if (bgp->process_queue)
work_queue_free_and_null(&bgp->process_queue);
if (bgp->process_queue)
work_queue_free_and_null(&bgp->process_queue);

if (!IS_BGP_INSTANCE_HIDDEN(bgp))
bgp_unlock(bgp); /* initial reference */
} else {
else {
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
enum vpn_policy_direction dir;

Expand Down
Empty file.
52 changes: 0 additions & 52 deletions tests/topotests/bgp_l3vpn_hidden/ce1/frr.conf

This file was deleted.

24 changes: 0 additions & 24 deletions tests/topotests/bgp_l3vpn_hidden/ce1/show_bgp_ipv4_unicast.json

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions tests/topotests/bgp_l3vpn_hidden/ce1/show_bgp_ipv6_unicast.json

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions tests/topotests/bgp_l3vpn_hidden/ce1/show_bgp_summary.json

This file was deleted.

107 changes: 0 additions & 107 deletions tests/topotests/bgp_l3vpn_hidden/pe1/frr.conf

This file was deleted.

29 changes: 0 additions & 29 deletions tests/topotests/bgp_l3vpn_hidden/pe1/show_bgp_ipv4_vpn.json

This file was deleted.

29 changes: 0 additions & 29 deletions tests/topotests/bgp_l3vpn_hidden/pe1/show_bgp_ipv6_vpn.json

This file was deleted.

Loading
Loading