Include the incomming port in PacketOut message. 62/4562/3
authorElek Jani <elekjani@gmail.com>
Wed, 22 Jan 2014 10:29:04 +0000 (11:29 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 23 Jan 2014 10:43:52 +0000 (10:43 +0000)
Without this flood messages do not omit the incomming port on the switch.

Change-Id: I932d00c1f17b95678cb73136aefa05fcc5718a95
Signed-off-by: Elek Jani <elekjani@gmail.com>
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DataPacketMuxDemux.java

index a1fcd1ab23b7c5a8836d5ad1200533b5a08a03ec..5c2af6d8b430471d25f68a68c25e8915c9d02e97 100644 (file)
@@ -313,9 +313,13 @@ public class DataPacketMuxDemux implements IContainerListener,
         // build packet out
         OFPacketOut po = new OFPacketOut()
                 .setBufferId(OFPacketOut.BUFFER_ID_NONE)
-                .setInPort(OFPort.OFPP_NONE)
                 .setActions(Collections.singletonList((OFAction) action))
                 .setActionsLength((short) OFActionOutput.MINIMUM_LENGTH);
+        if(outPkt.getIncomingNodeConnector() != null) {
+            po.setInPort((Short)outPkt.getIncomingNodeConnector().getID());
+        } else {
+            po.setInPort(OFPort.OFPP_NONE);
+        }
 
         po.setLengthU(OFPacketOut.MINIMUM_LENGTH + po.getActionsLength()
                 + data.length);