Skip to content
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

Merged
merged 6 commits into from
Oct 6, 2017

Conversation

arifogel
Copy link
Member

@arifogel arifogel commented Oct 6, 2017

No description provided.

@arifogel arifogel requested a review from dhalperi October 6, 2017 07:34
Copy link
Member

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. actual bug, a few suggestions.

!
router bgp 1
router-id 1.1.1.1
neighbor 1.2.0.2 remote-as 2
Copy link
Member

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();
Copy link
Member

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();
Copy link
Member

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());

Copy link
Member

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)

@arifogel arifogel merged commit 1230c51 into master Oct 6, 2017
@arifogel arifogel deleted the ari-fix-bgp-session-check-as-match branch October 6, 2017 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants