enable run reactive routing without BGP
Another improment is: if we config interfaces for local subnet
in network-cfg.json, sdn-ip will classify the traffic correctly
Change-Id: I94d80bc5a7c29b70e6c8546d99b71850cfb3f14d
diff --git a/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java b/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
index 0a6f9d4..19c3f70 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
@@ -195,13 +195,16 @@
}
BgpConfig bgpConfig = configService.getConfig(routerAppId, BgpConfig.class);
-
- return bgpConfig.bgpSpeakers().stream()
- .flatMap(speaker -> speaker.peers().stream())
- .map(peer -> interfaceService.getMatchingInterface(peer))
- .filter(intf -> intf != null)
- .map(intf -> intf.connectPoint())
- .collect(Collectors.toSet());
+ if (bgpConfig == null) {
+ return Collections.emptySet();
+ } else {
+ return bgpConfig.bgpSpeakers().stream()
+ .flatMap(speaker -> speaker.peers().stream())
+ .map(peer -> interfaceService.getMatchingInterface(peer))
+ .filter(intf -> intf != null)
+ .map(intf -> intf.connectPoint())
+ .collect(Collectors.toSet());
+ }
}
@Override