default switch if description is unknown
diff --git a/of/ctl/src/main/java/org/onlab/onos/of/controller/impl/OpenFlowControllerImpl.java b/of/ctl/src/main/java/org/onlab/onos/of/controller/impl/OpenFlowControllerImpl.java
index b0a6305..bade605 100644
--- a/of/ctl/src/main/java/org/onlab/onos/of/controller/impl/OpenFlowControllerImpl.java
+++ b/of/ctl/src/main/java/org/onlab/onos/of/controller/impl/OpenFlowControllerImpl.java
@@ -250,9 +250,12 @@
}
OpenFlowSwitch sw = activeMasterSwitches.remove(dpid);
if (sw == null) {
- log.error("Transition to equal called on sw {}, but switch "
- + "was not found in controller-cache", dpid);
- return;
+ sw = getSwitch(dpid);
+ if (sw == null) {
+ log.error("Transition to equal called on sw {}, but switch "
+ + "was not found in controller-cache", dpid);
+ return;
+ }
}
log.info("Transitioned switch {} to EQUAL", dpid);
activeEqualSwitches.put(dpid, sw);
diff --git a/of/ctl/src/main/java/org/onlab/onos/of/drivers/impl/DriverManager.java b/of/ctl/src/main/java/org/onlab/onos/of/drivers/impl/DriverManager.java
index 2c72c17..1744a76 100644
--- a/of/ctl/src/main/java/org/onlab/onos/of/drivers/impl/DriverManager.java
+++ b/of/ctl/src/main/java/org/onlab/onos/of/drivers/impl/DriverManager.java
@@ -2,10 +2,15 @@
+import java.util.Collections;
+import java.util.List;
+
import org.onlab.onos.of.controller.Dpid;
+import org.onlab.onos.of.controller.driver.AbstractOpenFlowSwitch;
import org.onlab.onos.of.controller.driver.OpenFlowSwitchDriver;
import org.onlab.onos.of.controller.driver.OpenFlowSwitchDriverFactory;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
+import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -51,8 +56,36 @@
}
log.warn("DriverManager could not identify switch desc: {}. "
- + "Assigning OFSwitchImplBase", desc);
- return null;
+ + "Assigning AbstractOpenFlowSwich", desc);
+ return new AbstractOpenFlowSwitch(dpid) {
+
+ @Override
+ public void write(List<OFMessage> msgs) {
+ channel.write(msgs);
+ }
+
+ @Override
+ public void write(OFMessage msg) {
+ channel.write(Collections.singletonList(msg));
+
+ }
+
+ @Override
+ public Boolean supportNxRole() {
+ return false;
+ }
+
+ @Override
+ public void startDriverHandshake() {}
+
+ @Override
+ public void processDriverHandshakeMessage(OFMessage m) {}
+
+ @Override
+ public boolean isDriverHandshakeComplete() {
+ return true;
+ }
+ };
}
/**