[ONOS-2155] Fix for OpenFlow hello version negotiation
Change-Id: Idf0f59dc9761cd4a1cfc2c91922ad22b2c1b5c20
diff --git a/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OFChannelHandler.java b/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OFChannelHandler.java
index 56dd085..730bf28 100644
--- a/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OFChannelHandler.java
+++ b/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OFChannelHandler.java
@@ -188,12 +188,13 @@
throws IOException {
// TODO We could check for the optional bitmap, but for now
// we are just checking the version number.
- if (m.getVersion() == OFVersion.OF_13) {
- log.debug("Received {} Hello from {}", m.getVersion(),
+ if (m.getVersion().getWireVersion() >= OFVersion.OF_13.getWireVersion()) {
+ log.debug("Received {} Hello from {} - switching to OF "
+ + "version 1.3", m.getVersion(),
h.channel.getRemoteAddress());
h.sendHandshakeHelloMessage();
h.ofVersion = OFVersion.OF_13;
- } else if (m.getVersion() == OFVersion.OF_10) {
+ } else if (m.getVersion().getWireVersion() >= OFVersion.OF_10.getWireVersion()) {
log.debug("Received {} Hello from {} - switching to OF "
+ "version 1.0", m.getVersion(),
h.channel.getRemoteAddress());