CORD-73 Change the way we configure host learning in segment routing
hostLearning config
- true: enable host learning
- false or not provided: disable host learning
suppressHost config
- all connect points listed here will be ignored
- no effect if hostLearning is false
- accept all hosts if this config is not provided
Change-Id: Id4a60bd47cac1f226ab8ba5391931ad2fb798529
diff --git a/src/main/java/org/onosproject/segmentrouting/McastHandler.java b/src/main/java/org/onosproject/segmentrouting/McastHandler.java
index d3d8759..96a2337 100644
--- a/src/main/java/org/onosproject/segmentrouting/McastHandler.java
+++ b/src/main/java/org/onosproject/segmentrouting/McastHandler.java
@@ -51,6 +51,7 @@
import org.onosproject.net.mcast.McastEvent;
import org.onosproject.net.mcast.McastRouteInfo;
import org.onosproject.net.topology.TopologyService;
+import org.onosproject.segmentrouting.config.SegmentRoutingAppConfig;
import org.onosproject.segmentrouting.storekey.McastStoreKey;
import org.onosproject.store.serializers.KryoNamespaces;
import org.onosproject.store.service.ConsistentMap;
@@ -345,11 +346,11 @@
*/
private void addFilterToDevice(DeviceId deviceId, PortNumber port, VlanId assignedVlan) {
// Do nothing if the port is configured as suppressed
- ConnectPoint connectPt = new ConnectPoint(deviceId, port);
- if (srManager.deviceConfiguration == null ||
- srManager.deviceConfiguration.suppressSubnet().contains(connectPt) ||
- srManager.deviceConfiguration.suppressHost().contains(connectPt)) {
- log.info("Ignore suppressed port {}", connectPt);
+ ConnectPoint connectPoint = new ConnectPoint(deviceId, port);
+ SegmentRoutingAppConfig appConfig = srManager.cfgService
+ .getConfig(srManager.appId, SegmentRoutingAppConfig.class);
+ if (appConfig != null && appConfig.suppressSubnet().contains(connectPoint)) {
+ log.info("Ignore suppressed port {}", connectPoint);
return;
}