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 <askorichenko@netgate.com>
  • Loading branch information
askorichenko committed Jan 16, 2025
1 parent 0bc373c commit c1a9dfd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3401,18 +3401,20 @@ static struct bgp *bgp_create(as_t *as, const char *name,
afi_t afi;
safi_t safi;

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

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

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

0 comments on commit c1a9dfd

Please sign in to comment.