-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
bgpd: update AS value of a hidden bgp instance #17861
base: master
Are you sure you want to change the base?
Conversation
Let config have
This operation defines a 'hidden bgp' in the default vrf
To define a real bgp router in the default vrf now, this hidden structure would be selected for update.
This patch of bgp_create() adds an overwrite of as, as_pretty values for a hidden bgp instance. |
'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>
91f3e1c
to
c1a9dfd
Compare
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we don't have bgp->peer
allocated, and bgp->peer->cmp = (int (*)(void *, void *))peer_cmp;
will segfault after goto peer_init;
.
Also, we should respect AS notation...
I'd like to see a topotest for this situation... Unless @ton31337 doesn't think we need it. |
Agree, a topotest would be great 👍 |
'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.