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

IOS fix aggregate-address implementation #7075

Merged
merged 7 commits into from
Jun 18, 2021

Conversation

arifogel
Copy link
Member

@arifogel arifogel commented Jun 17, 2021

@batfish-bot
Copy link

This change is Reviewable

@codecov
Copy link

codecov bot commented Jun 17, 2021

Codecov Report

Merging #7075 (db1d2c5) into master (020d79e) will decrease coverage by 0.00%.
The diff coverage is 70.87%.

@@             Coverage Diff              @@
##             master    #7075      +/-   ##
============================================
- Coverage     71.97%   71.97%   -0.01%     
- Complexity    37888    37903      +15     
============================================
  Files          3043     3043              
  Lines        155068   155101      +33     
  Branches      18633    18630       -3     
============================================
+ Hits         111612   111627      +15     
- Misses        34541    34553      +12     
- Partials       8915     8921       +6     
Impacted Files Coverage Δ
...fish/representation/cisco/BgpAggregateNetwork.java 65.00% <45.45%> (-25.00%) ⬇️
.../representation/cisco/BgpAggregateIpv4Network.java 44.44% <47.61%> (+17.17%) ⬆️
.../representation/cisco/BgpAggregateIpv6Network.java 40.74% <47.61%> (+13.46%) ⬆️
...fish/grammar/cisco/CiscoControlPlaneExtractor.java 61.71% <95.12%> (+0.35%) ⬆️
...tfish/representation/cisco/CiscoConfiguration.java 83.81% <100.00%> (-0.28%) ⬇️
...batfish/representation/cisco/CiscoConversions.java 85.56% <100.00%> (+0.05%) ⬆️
...fish/representation/cisco/CiscoStructureUsage.java 100.00% <100.00%> (ø)
...src/main/java/org/batfish/coordinator/PoolMgr.java 55.95% <0.00%> (-3.58%) ⬇️
...col/src/main/java/org/batfish/role/InferRoles.java 91.36% <0.00%> (-1.37%) ⬇️
...ain/java/org/batfish/storage/FileBasedStorage.java 84.50% <0.00%> (-0.93%) ⬇️
... and 7 more

Copy link
Contributor

@corinaminer corinaminer 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, 3 of 9 files at r2, 5 of 5 files at r3.
Reviewable status: 13 of 19 files reviewed, 2 unresolved discussions (waiting on @arifogel)


projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 3718 at r4 (raw file):

    // Intentional identity comparison
    if (_currentPeerGroup == proc.getMasterBgpPeerGroup()) {
      if (ctx.network != null || ctx.prefix != null) {

nit: might be cleaner to check if _currentIpv4Aggregate != null and then else { assert _currentIpv6Aggregate != null; ... }


projects/batfish/src/main/java/org/batfish/representation/cisco/BgpAggregateIpv4Network.java, line 12 at r4 (raw file):

@ParametersAreNonnullByDefault
public class BgpAggregateIpv4Network extends BgpAggregateNetwork {

Shouldn't there be analogous changes in BgpAggregateIpv6Network?


projects/batfish/src/main/java/org/batfish/representation/cisco/BgpAggregateIpv4Network.java, line 56 at r4 (raw file):

  @Override
  public String toString() {

not really sure why you generate these in the first place, but should omitNullValues if you do

Copy link
Member Author

@arifogel arifogel 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: 11 of 19 files reviewed, 1 unresolved discussion (waiting on @corinaminer)


projects/batfish/src/main/java/org/batfish/grammar/cisco/CiscoControlPlaneExtractor.java, line 3718 at r4 (raw file):

Previously, corinaminer (Corina Miner) wrote…

nit: might be cleaner to check if _currentIpv4Aggregate != null and then else { assert _currentIpv6Aggregate != null; ... }

right, this code was just moved.
done.


projects/batfish/src/main/java/org/batfish/representation/cisco/BgpAggregateIpv4Network.java, line 12 at r4 (raw file):

Previously, corinaminer (Corina Miner) wrote…

Shouldn't there be analogous changes in BgpAggregateIpv6Network?

Done, but probably a waste of time until we implement IPv6 in 2050.


projects/batfish/src/main/java/org/batfish/representation/cisco/BgpAggregateIpv4Network.java, line 56 at r4 (raw file):

Previously, corinaminer (Corina Miner) wrote…

not really sure why you generate these in the first place, but should omitNullValues if you do

Because a test failed and I couldn't read the output, of course.
Done.

Copy link
Contributor

@corinaminer corinaminer 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 9 files at r2, 1 of 1 files at r4, 1 of 2 files at r5, 2 of 2 files at r6.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @arifogel)


projects/batfish/src/main/java/org/batfish/representation/cisco/BgpAggregateIpv4Network.java, line 12 at r4 (raw file):

Previously, arifogel (Ari Fogel) wrote…

Done, but probably a waste of time until we implement IPv6 in 2050.

yeahh i hear that, but too freaky to write baseEquals/baseHashcode and then not use them in all child classes


projects/batfish/src/test/java/org/batfish/grammar/cisco/CiscoGrammarTest.java, line 6026 at r4 (raw file):

    assertThat(
        aggs,
        hasEntry(

nit: you don't need all the equalTos; hasEntry(Object, Object) exists


projects/batfish/src/test/resources/org/batfish/grammar/cisco/testrigs/bgp-agg-learned-contributors/configs/c1, line 9 at r4 (raw file):

!
! Next hop for static routes
interface GigabitEthernet0/1

unused


projects/batfish/src/test/resources/org/batfish/grammar/cisco/testrigs/bgp-agg-learned-contributors/configs/c1, line 23 at r4 (raw file):

  neighbor 10.10.10.2 activate
  neighbor 10.10.10.2 route-map ALLOW-ALL in
  neighbor 10.10.10.2 route-map ALLOW-ALL out

Unlike XR, the IOS default is to allow all when no route-map is configured, so you could drop the route-maps.

Copy link
Member Author

@arifogel arifogel 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: 19 of 20 files reviewed, 3 unresolved discussions (waiting on @corinaminer)


projects/batfish/src/test/java/org/batfish/grammar/cisco/CiscoGrammarTest.java, line 6026 at r4 (raw file):

Previously, corinaminer (Corina Miner) wrote…

nit: you don't need all the equalTos; hasEntry(Object, Object) exists

hasEntry(Object, Object) uses reference equality IIRC, unfortunately. So it's not always safe.


projects/batfish/src/test/resources/org/batfish/grammar/cisco/testrigs/bgp-agg-learned-contributors/configs/c1, line 9 at r4 (raw file):

Previously, corinaminer (Corina Miner) wrote…

unused

Removed


projects/batfish/src/test/resources/org/batfish/grammar/cisco/testrigs/bgp-agg-learned-contributors/configs/c1, line 23 at r4 (raw file):

Previously, corinaminer (Corina Miner) wrote…

Unlike XR, the IOS default is to allow all when no route-map is configured, so you could drop the route-maps.

Doesn't it depend on eBGP/iBGP? Regardless, just gonna leave it for now, since it reduces uncertainty for the reader.

Copy link
Member Author

@arifogel arifogel 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: 19 of 20 files reviewed, 3 unresolved discussions (waiting on @corinaminer)


projects/batfish/src/test/java/org/batfish/grammar/cisco/CiscoGrammarTest.java, line 6026 at r4 (raw file):

Previously, arifogel (Ari Fogel) wrote…

hasEntry(Object, Object) uses reference equality IIRC, unfortunately. So it's not always safe.

Or maybe it was that if one arg is a Matcher, it checks if the other arg is equal to the Matcher arg. Regardless, this is fail-safe, so leaving it.

Copy link
Member Author

@arifogel arifogel left a 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 r7.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @arifogel)

@arifogel arifogel merged commit 56887f0 into batfish:master Jun 18, 2021
@arifogel arifogel deleted the ari-ios-bgp-aggregate branch June 18, 2021 01:44
Copy link
Contributor

@corinaminer corinaminer 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: :shipit: complete! all files reviewed, all discussions resolved


projects/batfish/src/test/resources/org/batfish/grammar/cisco/testrigs/bgp-agg-learned-contributors/configs/c1, line 23 at r4 (raw file):

Previously, arifogel (Ari Fogel) wrote…

Doesn't it depend on eBGP/iBGP? Regardless, just gonna leave it for now, since it reduces uncertainty for the reader.

👍 just to follow up: XR depends EBGP/IBGP (denies if no route-map in EBGP, permits if no route-map in IBGP); IOS permits in both cases.

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.

Cisco IOS aggregate address null route
3 participants