From: Artur Downar Date: Wed, 27 Nov 2013 16:53:47 +0000 (+0100) Subject: Fix bug 171. EchoReply payload must be the same as the correspoding EchoRequest payload X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~312^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;ds=sidebyside;h=refs%2Fchanges%2F43%2F3143%2F3;p=controller.git Fix bug 171. EchoReply payload must be the same as the correspoding EchoRequest payload Change-Id: I096f8389068948faad734ae1fef4b9b40b0f3cb9 Signed-off-by: Artur Downar --- diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/SwitchHandler.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/SwitchHandler.java index 6fddef06a8..ed79d5c5a8 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/SwitchHandler.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/core/internal/SwitchHandler.java @@ -38,6 +38,7 @@ import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitch; import org.openflow.protocol.OFBarrierReply; import org.openflow.protocol.OFBarrierRequest; import org.openflow.protocol.OFEchoReply; +import org.openflow.protocol.OFEchoRequest; import org.openflow.protocol.OFError; import org.openflow.protocol.OFFeaturesReply; import org.openflow.protocol.OFFlowMod; @@ -371,6 +372,12 @@ public class SwitchHandler implements ISwitch { break; case ECHO_REQUEST: OFEchoReply echoReply = (OFEchoReply) factory.getMessage(OFType.ECHO_REPLY); + + // the EchoReply must have the same payload as the request + byte []payload = ((OFEchoRequest)msg).getPayload(); + echoReply.setPayload(payload); + echoReply.setLength( (short) (echoReply.getLength() + payload.length )); + // respond immediately asyncSendNow(echoReply, msg.getXid());