Bug fix in routing logic - should let routing process continue
if a particular route-path is ignored. Also added info logging for port-status
messages to clearly identify messages coming from the switch as opposed
to possibly fake updates generated by ONOS.
Change-Id: Ib03dfe0e2dcdcfb046d58657473fa4122ec15190
diff --git a/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java b/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
index 9844106..8b240e6 100644
--- a/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
+++ b/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
@@ -703,6 +703,11 @@
DeviceId targetSw = route.get(0);
DeviceId dstSw = route.get(1); // same as impactedDstDevice
Set<DeviceId> nextHops = getNextHops(targetSw, dstSw);
+ if (nextHops.isEmpty()) {
+ log.warn("Could not find next hop from target:{} --> dst {} "
+ + "skipping this route", targetSw, dstSw);
+ continue;
+ }
Map<DeviceId, Set<DeviceId>> nhops = new HashMap<>();
nhops.put(dstSw, nextHops);
if (!populateEcmpRoutingRulePartial(targetSw, dstSw, null, nhops,