Repository navigation
Validate the AS number of BGP peers - #14976
Open
MitchDrage wants to merge 1 commit into
Open
MitchDrage wants to merge 1 commit into
MitchDrage wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds AS number validation to
createBgpPeerandupdateBgpPeer, which currently accept any value.I created a peer with AS 0, and FRR 8.4.4 rejected its neighbour line, so the peer existed in CloudStack but was never configured on the router.
RoutedIpv4Manager.validateBgpPeerAsNumberaccepts 1 to 4294967295 and refuses 23456 (AS_TRANS, RFC 6793), 65535 and 4294967295 (RFC 7300).createBgpPeeralways checks the AS number.updateBgpPeerchecks it only when it changes, so an existing peer with an invalid AS number can still have its other fields updated.RoutedIpv4ManagerImplBgpPeerAsnTest.Fixes: #14939
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
RoutedIpv4ManagerImplBgpPeerAsnTest(15 tests) andRoutedIpv4ManagerImplTest(57 tests) pass. On main without this change, the 7 tests that expect a refusal fail and the 8 that expect a valid AS number to be accepted pass.createBgpPeercreateBgpPeerupdateBgpPeerupdateBgpPeerupdateBgpPeerHow did you try to break this feature and the system with this change?
asnumber, and with its current AS number, to check the update path still saves.