Skip to content

Commit

Permalink
OSPF: not-advertised summaries do not install a discard route
Browse files Browse the repository at this point in the history
Since the summary isn't advertised, there's no need to install this discard route to
prevent a loop that can't happen.
  • Loading branch information
dhalperi committed Mar 12, 2021
1 parent 75e21f9 commit 6d083fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -740,12 +740,14 @@ private RibDelta<OspfInterAreaRoute> computeInterAreaSummariesForArea(OspfArea a
private RibDelta<OspfInternalSummaryRoute> computeInternalSummariesForArea(OspfArea area) {
RibDelta.Builder<OspfInternalSummaryRoute> deltaBuilder = RibDelta.builder();
area.getSummaries()
.keySet()
.forEach(
prefix ->
(prefix, summary) -> {
if (summary.getAdvertised()) {
computeInternalSummaryRoute(prefix, area.getAreaNumber())
// TODO: support withdrawals
.ifPresent(r -> deltaBuilder.from(_internalSummaryRib.mergeRouteGetDelta(r))));
.ifPresent(r -> deltaBuilder.from(_internalSummaryRib.mergeRouteGetDelta(r)));
}
});
return deltaBuilder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,10 +909,11 @@ public void testOspfDualAreaBackboneInterAreaPropagationR2E21SummarizeNoAdvertis
assertRoute(routesByNode, OSPF_IA, C1_NAME, C3_E3_4_ADDRESS, 3L);
assertRoute(routesByNode, OSPF, C2_NAME, C1_L0_ADDRESS, 2L);
// summary discard route
assertRoute(routesByNode, OSPF_IS, C2_NAME, C1_L0_SUMMARY_PREFIX, 0L);
assertRoute(routesByNode, OSPF, C2_NAME, C3_L0_ADDRESS, 2L);
assertRoute(routesByNode, OSPF, C2_NAME, C4_L0_ADDRESS, 3L);
assertRoute(routesByNode, OSPF, C2_NAME, C3_E3_4_ADDRESS, 2L);
// summary discard route not installed for no-advertise
assertNoRoute(routesByNode, C2_NAME, C1_L0_SUMMARY_PREFIX);
// summary prefix not advertised
assertNoRoute(routesByNode, C3_NAME, C1_L0_SUMMARY_PREFIX);
// suppressed by summary
Expand Down

0 comments on commit 6d083fe

Please sign in to comment.