mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-01-24 18:11:24 +01:00
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>
This commit is contained in:
parent
b09b39c11d
commit
99d641c7d4
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user