BUG-801 Fix end of TLV in LLDP packet 06/6406/1
authorMoiz Raja <moraja@cisco.com>
Thu, 30 Jan 2014 20:46:22 +0000 (12:46 -0800)
committerMoiz Raja <moraja@cisco.com>
Fri, 25 Apr 2014 21:37:26 +0000 (14:37 -0700)
Change-Id: Id2964757439748a931c334190ca94d21b254ef6e
Signed-off-by: Diti Bhatia <dibhatia@cisco.com>
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDP.java

index 95edca943bc8a61681c34c582f4aeb9dddb7972e..6f5cf04a529ed5a2872ff1d7c299eac71a1e060a 100644 (file)
@@ -198,6 +198,9 @@ public class LLDP extends Packet {
         while (lldpSize > 0) {
             LLDPTLV tlv = new LLDPTLV();
             tlv.deserialize(data, lldpOffset, lldpSize);
+            if (tlv.getType() == 0 && tlv.getLength() == 0) {
+               break;
+            }
             int tlvSize = tlv.getTLVSize(); // Size of current TLV in bits
             lldpOffset += tlvSize;
             lldpSize -= tlvSize;