summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonas Grunert <jonasg@google.com>2016-07-14 17:34:15 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-07-14 17:34:15 +0900
commit99d641c7d406833b76530910362db686c2e461da (patch)
treee2444028532418b81a3edfea402f8dfb5323daf1
parentb09b39c11dd4f2e2e0d2d0a70ede9e3cef917e93 (diff)
Fix: LLDP.OrganizationallySpecific not ignoring info field
LLDP.OrganizationallySpecificTLV did not set info field and produced malformed LLDP packets Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/lib/packet/lldp.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ryu/lib/packet/lldp.py b/ryu/lib/packet/lldp.py
index d0cae2fa..95425196 100644
--- a/ryu/lib/packet/lldp.py
+++ b/ryu/lib/packet/lldp.py
@@ -479,6 +479,7 @@ class OrganizationallySpecific(LLDPBasicTLV):
if buf:
(self.oui, self.subtype) = struct.unpack(
self._PACK_STR, self.tlv_info[:self._PACK_SIZE])
+ self.info = self.tlv_info[self._PACK_SIZE:]
else:
self.oui = kwargs['oui']
self.subtype = kwargs['subtype']
@@ -488,7 +489,8 @@ class OrganizationallySpecific(LLDPBasicTLV):
self.typelen = (self.tlv_type << LLDP_TLV_TYPE_SHIFT) | self.len
def serialize(self):
- return struct.pack('!H3sB', self.typelen, self.oui, self.subtype)
+ return struct.pack('!H3sB', self.typelen, self.oui,
+ self.subtype) + self.info
lldp.set_classes(lldp._tlv_parsers)