Skip to content

Commit

Permalink
bgpd: update AS value of a hidden bgp instance
Browse files Browse the repository at this point in the history
'import vrf CUSTOM' could define a hidden bgp instance with
the default AS_UNSPECIFIED (i.e. = 1) value.
When a
	router bgp AS vrf CUSTOM
gets configured later on, replace this AS_UNSPECIFIED setting
with a requested value.

Signed-off-by: Alexander Skorichenko <[email protected]>
  • Loading branch information
askorichenko committed Jan 15, 2025
1 parent 0bc373c commit 91f3e1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3403,7 +3403,8 @@ static struct bgp *bgp_create(as_t *as, const char *name,

if (hidden) {
bgp = bgp_old;
goto peer_init;
} else {
bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp));
}

bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp));
Expand All @@ -3413,6 +3414,10 @@ static struct bgp *bgp_create(as_t *as, const char *name,
else
bgp->as_pretty = XSTRDUP(MTYPE_BGP_NAME, asn_asn2asplain(*as));

if (hidden) {
goto peer_init;
}

if (asnotation != ASNOTATION_UNDEFINED) {
bgp->asnotation = asnotation;
SET_FLAG(bgp->config, BGP_CONFIG_ASNOTATION);
Expand Down

0 comments on commit 91f3e1c

Please sign in to comment.