Minor fixes to lldp speaker and packet out 25/3925/1
authorEd Warnicke <eaw@cisco.com>
Wed, 25 Dec 2013 22:15:25 +0000 (14:15 -0800)
committerEd Warnicke <eaw@cisco.com>
Wed, 25 Dec 2013 22:15:25 +0000 (14:15 -0800)
Change-Id: Ide87f078a26a83e60468047e03c6e8543d34a9b2
Signed-off-by: Ed Warnicke <eaw@cisco.com>
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/PacketOutConvertor.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/lldp/LLDPSpeaker.java

index b2de4e833786d8686c2c4218898d2f6d72f05bea..e88a5a7a77c489ae7bd33941f1a82ace74a0c766 100644 (file)
@@ -43,16 +43,18 @@ public class PacketOutConvertor {
      // Build Port ID from TransmitPacketInput.Ingress
         PortNumber inPortNr = null;
         
-        List<PathArgument> inArgs = inputPacket.getIngress().getValue().getPath();
-        if (inArgs.size() >= 3) {
+        List<PathArgument> inArgs = null;
+        if (inputPacket.getIngress() != null) {
+            inArgs = inputPacket.getIngress().getValue().getPath();
+        }
+        if (inArgs != null && inArgs.size() >= 3) {
             inPortNr = getPortNumber(inArgs.get(2));
         } else {
-            // TODO Ed could by in this way or Exception or something else ?
+            // The packetOut originated from the controller
             inPortNr = new PortNumber(0xfffffffdL);
         }
         
-        // Build Buffer ID from TransmitPacketInput.Ingress
-        // TODO VD P! find how to fix PacketIn to add BufferID to augmetation
+        // Build Buffer ID to be NO_OFP_NO_BUFFER
         Long bufferId = OFConstants.OFP_NO_BUFFER;
         
         PortNumber outPort = null;
index 0488a7dee05acb6bef579339f662f306268cc672..f5e0555d004c35dc5e8e27ad1dcefa0fb7720c56 100644 (file)
@@ -116,8 +116,7 @@ public class LLDPSpeaker {
         portIdTlv.setType(LLDPTLV.TLVType.PortID.getValue());
 
         // Create LLDP Custom TLV
-        NodeConnectorRef ncref = new NodeConnectorRef(nodeConnectorInstanceId);
-        byte[] customValue = LLDPTLV.createCustomTLVValue(ncref.toString());
+        byte[] customValue = LLDPTLV.createCustomTLVValue(nodeConnectorId.getValue());
         LLDPTLV customTlv = new LLDPTLV();
         customTlv.setType(LLDPTLV.TLVType.Custom.getValue()).setLength((short) customValue.length)
                 .setValue(customValue);