-
Notifications
You must be signed in to change notification settings - Fork 228
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
Implement Cisco bgp neighbor local-as and add as-check to BgpSessionCheck #511
Conversation
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.
- actual bug, a few suggestions.
! | ||
router bgp 1 | ||
router-id 1.1.1.1 | ||
neighbor 1.2.0.2 remote-as 2 |
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.
Would be nice to add a comment here explaining that the local as number is 1
because Cisco family devices default to the process id.
@@ -376,6 +382,9 @@ private void inheritUnsetFields(BgpPeerGroup pg) { | |||
_inboundRoute6Map = pg.getInboundRoute6Map(); | |||
_inboundRoute6MapLine = pg.getInboundRoute6MapLine(); | |||
} | |||
if (_localAs == null) { | |||
_localAs = pg.getMaximumPaths(); |
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.
this looks like a bug – copy and paste error?
@@ -2022,7 +2022,8 @@ private AsPathAccessListLine toAsPathAccessListLine(AsPathSetElem elem) { | |||
_w.redFlag("No remote-as set for peer: " + lpg.getName()); | |||
continue; | |||
} | |||
|
|||
Integer pgLocalAs = lpg.getLocalAs(); | |||
int localAs = pgLocalAs != null ? pgLocalAs : proc.getName(); |
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.
simpler: int localAs = firstNonNull(lpg.getLocalAs(), proc.getName());
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.
(import static com.google.common...?...MoreObjects.firstNonNull from guava)
No description provided.