-
Notifications
You must be signed in to change notification settings - Fork 229
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
Changes for "additive" in "set community" for FRR. #5327
Conversation
Fixed compile errors to enable "additive" in "set community" command. Removed comments from RouteMapSetCommunity.java. Removed commented code.
Codecov Report
@@ Coverage Diff @@
## master #5327 +/- ##
============================================
- Coverage 73.33% 73.3% -0.03%
+ Complexity 32051 32036 -15
============================================
Files 2624 2624
Lines 129272 129304 +32
Branches 15557 15562 +5
============================================
- Hits 94796 94787 -9
- Misses 26953 26989 +36
- Partials 7523 7528 +5
|
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.
Reviewed 2 of 4 files at r1, 2 of 2 files at r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @raveranj)
a discussion (no related file):
The correct implementation of set community ... additive
is non-trivial, and unfortunately not achieved here.
Fortunately, there are working examples that can be followed for other vendors.
See org.batfish.representation.cisco_nxos.RouteMapSetCommunity
, and follow its usage throughout the project.
You can contact me directly on Batfish slack with any questions.
projects/batfish/src/main/java/org/batfish/grammar/cumulus_frr/CumulusFrrConfigurationBuilder.java, line 866 at r2 (raw file):
public void exitRms_community(Rms_communityContext ctx) { RouteMapSetCommunity old = _currentRouteMapEntry.getSetCommunity(); if (ctx.ADDITIVE() == null) {
The only thing that should happen here when additive
appears on a set community
line is that the RouteMapSetCommunity
that gets created should be marked as additive. You should not modify the existing RouteMapSetCommunity
- rather, it should be replaced entirely.
projects/batfish/src/main/java/org/batfish/representation/cumulus/RouteMapSetCommunity.java, line 21 at r2 (raw file):
private boolean _isAdditive; public void set_isAdditive() {
nit: we use slouching camel case for property setters and getters.
Suggest: _additive
, getAdditive
, setAdditive
.
projects/batfish/src/main/java/org/batfish/representation/cumulus/RouteMapSetCommunity.java, line 51 at r2 (raw file):
ArrayList<StandardCommunity> commList = communities.stream().collect(Collectors.toCollection(ArrayList::new)); if (get_isAdditive()) {
The behavior you have implemented here does not reflect the behavior of a Cumulus device when a set community xx:yy additive
command is entered,
Whenever a set community
line appears in a route-map, it replaces any existing one.
The meaning of additive
is that the communities mentioned should be added to the communities of a route to be processed, rather than replacing the communities of the route to be processed.
This function should not be altered.
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.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @raveranj)
a discussion (no related file):
Need to add a test case to org.batfish.representation.cumiulus.RouteMapSetCommunityTest
projects/batfish/src/main/java/org/batfish/representation/cumulus/RouteMapSetCommunity.java, line 51 at r2 (raw file): Previously, arifogel (Ari Fogel) wrote…
Sync-ed up with Ari offline. Fixing up the behavior. Thanks Ari! |
…ses. Extend cumulus/RouteMapSetCommunity to support "additive" in set clauses. Added note regarding usage of two "set community" clauses in a route-map.
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.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @arifogel and @raveranj)
a discussion (no related file):
Hi @raveranj - need anything to keep going here?
Hey @dhalperi - Should have an updated PR today (latest tomorrow). |
…ure/frr_additive
… aren't standard communities. Needed for EVPN scenarios.
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.
Reviewed 2 of 6 files at r3, 5 of 5 files at r4.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @raveranj)
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.
Reviewed 1 of 1 files at r5.
Reviewable status: complete! all files reviewed, all discussions resolved
Fixed compile errors to enable "additive" in "set community" command.
Removed comments from RouteMapSetCommunity.java.
Removed commented code.