-
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
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. |
91f3e1c
to
c1a9dfd
Compare
I'd like to see a topotest for this situation... Unless @ton31337 doesn't think we need it. |
Agree, a topotest would be great 👍 |
Hi, |
c1a9dfd
to
2d4c67b
Compare
2d4c67b
to
f0b544d
Compare
The current code has
The logic of this change adds setting 3 values from the function arguments
It's only written slightly different to utilize identical code for the '! hidden' case. Please review |
Hello, |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@askorichenko could you rebase please? |
'import vrf VRF' could define a hidden bgp instance with the default AS_UNSPECIFIED (i.e. = 1) value. When a router bgp AS vrf VRF gets configured later on, replace this AS_UNSPECIFIED setting with a requested value. Signed-off-by: Alexander Skorichenko <[email protected]>
f0b544d
to
4358f12
Compare
Done |
else | ||
bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp)); | ||
|
||
bgp->as = *as; |
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.
You are duplicating code that are just after the peer_init label
4358f12#diff-2a485107bd513dd693e99b63de03350c46f55affadfda5082728e7060a0ce021R3479
Duplication is incorrect and it creates some memory leaks.
I have found the same issue and here is my fix. I am doing the same thing without duplicating code.
4ea376f
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.
So, can you both combine two PRs in a single one, but have a topotest which is here?
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.
yes
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.
Commit collides with
commit 2ff08af78e315c69795417d150cd23649f68c655
Author: Chirag Shah <[email protected]>
Date: Mon Feb 10 18:56:15 2025 -0800
bgpd: fix bgp vrf instance creation from implicit
merged 3 days ago
Here is the above patch by @chiragshah6
https://github.com/FRRouting/frr/pull/18081/files,
And that patch's code obviously zlog_debugs a null string in line 3425 of the new version of the file bgpd/bgpd.c.
Reverting to the previous version of my patch (this preserves log messaging order)
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.
Feel free to provide your own patch. But use a working topotest. For example: 0b2b477
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.
And that patch's code obviously zlog_debugs a null string in line 3425 of the new version of the file bgpd/bgpd.c.
the null pointer issue is fixed in #18119
Your fix was obviously wrong and the test was not testing anything. I am fixing your issue in #18119 If it is not fixing your issue, please open a new pull-request and we will look at it. |
'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.