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/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
index 9844106..8b240e6 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
+++ b/apps/segmentrouting/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,
diff --git a/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OFChannelHandler.java b/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OFChannelHandler.java
index 2714b8e..769fa2d 100644
--- a/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OFChannelHandler.java
+++ b/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OFChannelHandler.java
@@ -1012,6 +1012,8 @@
"happen");
throw new SwitchStateException(msg);
}
+ log.info("Received port status message from {}/{}: {}",
+ h.sw.getDpid(), m.getDesc().getPortNo(), m);
h.sw.handleMessage(m);
}