board-descriptor: allow 0xffff as end tag

with latest nmhw21 boards 0xffff have been introduced as a new end tag
(with or without intention). Tag 65535 is now handled the same way as
Tag 0 (aka end-tag).

BugzId: 55411

Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
This commit is contained in:
Patrick Zysset 2019-01-29 15:43:02 +01:00
parent adb53649bc
commit 18bf58e094
1 changed files with 3 additions and 3 deletions

View File

@ -155,10 +155,10 @@ class _BdRaw:
j = 0
self.tlvs = []
while i < self.buffer_len + 8:
# Zero means end of bd
# Zero or 0xffff means end of bd
tag = self._get_hw(data[i:i + 2])
i += 2
if tag == 0:
if tag == 0 or tag == 0xffff:
i -= 2
break
length = self._get_hw(data[i:i + 2])
@ -175,7 +175,7 @@ class _BdRaw:
data_length = self._read_binary(data)
if self.checksum != 0:
if self.checksum != 0 and self.checksum != 0xffff:
self._verify_checksum(data[8:data_length], self.checksum)
else:
self.is_writable = True