utils: tolerate uninitialized fields in dec_addr_tlv

TLV fields holding an address may still be uninitialized and hence
filled with 0xff bytes. Lets interpret those fields in the same way as
we interpret empty fields.

Related: OS#6094
Change-Id: Idc0a92ea88756266381c8da2ad62de061a8ea7a1
This commit is contained in:
Philipp Maier 2023-07-27 10:38:38 +02:00
parent 784b947b11
commit 1f46f07e3c
1 changed files with 4 additions and 0 deletions

View File

@ -771,6 +771,10 @@ def dec_addr_tlv(hexstr):
if tlv[1] == 0:
continue
# Uninitialized field
if all([v == 0xff for v in tlv[2]]):
continue
# First byte in the value has the address type
addr_type = tlv[2][0]
# TODO: Support parsing of IPv6