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

JunOS: parse and warn on no-prepend-global-as #6711

Merged
merged 3 commits into from
Mar 10, 2021

Conversation

dhalperi
Copy link
Member

Add missing warnings for related constructs.

This is for #6710.

Add missing warnings for related constructs.

This is for batfish#6710.
@batfish-bot
Copy link

This change is Reviewable

@codecov
Copy link

codecov bot commented Mar 10, 2021

Codecov Report

Merging #6711 (ac32537) into master (05c2275) will decrease coverage by 0.00%.
The diff coverage is 71.42%.

@@             Coverage Diff              @@
##             master    #6711      +/-   ##
============================================
- Coverage     73.67%   73.67%   -0.01%     
- Complexity    37038    37061      +23     
============================================
  Files          2942     2943       +1     
  Lines        148495   148563      +68     
  Branches      17862    17869       +7     
============================================
+ Hits         109406   109452      +46     
- Misses        30519    30537      +18     
- Partials       8570     8574       +4     
Impacted Files Coverage Δ Complexity Δ
...fish/grammar/flatjuniper/ConfigurationBuilder.java 72.85% <50.00%> (+0.03%) 885.00 <1.00> (+2.00)
...h/representation/juniper/JuniperConfiguration.java 88.37% <60.00%> (-0.07%) 474.00 <0.00> (+4.00) ⬇️
...a/org/batfish/representation/juniper/BgpGroup.java 89.78% <100.00%> (+0.38%) 69.00 <2.00> (+3.00)
...g/batfish/representation/fortios/InterfaceAny.java 0.00% <0.00%> (-75.00%) 0.00% <0.00%> (-3.00%)
...g/batfish/datamodel/flow/IncomingSessionScope.java 84.61% <0.00%> (-15.39%) 7.00% <0.00%> (-1.00%)
...ain/java/org/batfish/symbolic/IngressLocation.java 65.78% <0.00%> (-2.64%) 15.00% <0.00%> (-1.00%)
...va/org/batfish/representation/fortios/Address.java 91.78% <0.00%> (-2.43%) 22.00% <0.00%> (+1.00%) ⬇️
...va/org/batfish/representation/fortios/Service.java 92.07% <0.00%> (-1.74%) 51.00% <0.00%> (+1.00%) ⬇️
...ain/java/org/batfish/storage/FileBasedStorage.java 84.50% <0.00%> (-0.67%) 249.00% <0.00%> (ø%)
...src/main/java/org/batfish/coordinator/WorkMgr.java 75.81% <0.00%> (-0.16%) 247.00% <0.00%> (ø%)
... and 6 more

Copy link
Member

@ratulm ratulm left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @corinaminer and @dhalperi)


projects/batfish/src/main/java/org/batfish/grammar/flatjuniper/ConfigurationBuilder.java, line 3842 at r1 (raw file):

  @Override
  public void exitBl_no_prepend_global_as(Bl_no_prepend_global_asContext ctx) {
    todo(ctx);

I'll double check in a bit but I thought this is what Batfish does by default. If so, we need to warn when something else happens.

Copy link
Member

@ratulm ratulm left a 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, 1 unresolved discussion (waiting on @corinaminer and @dhalperi)


projects/batfish/src/main/java/org/batfish/grammar/flatjuniper/ConfigurationBuilder.java, line 3842 at r1 (raw file):

Previously, ratulm wrote…

I'll double check in a bit but I thought this is what Batfish does by default. If so, we need to warn when something else happens.

Judging by the FRR warning behavior (

) which I fixed in consultation with Victor, we implement what in FRR is no-prepend replace-as. Per https://docs.frrouting.org/en/latest/bgp.html#clicmd-neighborPEERlocal-asAS-NUMBER[no-prepend][replace-as], this means that (only) local-as will be prepended (not global).

IIUC, JunOS documentation (https://www.juniper.net/documentation/en_US/junos/topics/reference/configuration-statement/local-as-edit-protocols-bgp.html) says that no-prepend-global-as means that only local-as is prepended.

If I am reading this all right -- no guarantee there -- then we should warn on private/alias options.

Copy link
Member Author

@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.

Reviewable status: 3 of 8 files reviewed, 1 unresolved discussion (waiting on @corinaminer and @ratulm)


projects/batfish/src/main/java/org/batfish/grammar/flatjuniper/ConfigurationBuilder.java, line 3842 at r1 (raw file):

Previously, ratulm wrote…

Judging by the FRR warning behavior (

) which I fixed in consultation with Victor, we implement what in FRR is no-prepend replace-as. Per https://docs.frrouting.org/en/latest/bgp.html#clicmd-neighborPEERlocal-asAS-NUMBER[no-prepend][replace-as], this means that (only) local-as will be prepended (not global).

IIUC, JunOS documentation (https://www.juniper.net/documentation/en_US/junos/topics/reference/configuration-statement/local-as-edit-protocols-bgp.html) says that no-prepend-global-as means that only local-as is prepended.

If I am reading this all right -- no guarantee there -- then we should warn on private/alias options.

TAL.

Copy link
Member

@ratulm ratulm left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 5 files at r2, 2 of 2 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @corinaminer)

@dhalperi dhalperi merged commit 0753a61 into batfish:master Mar 10, 2021
@dhalperi dhalperi deleted the junos-no-prepend-global-as branch March 10, 2021 23:28
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

3 participants