tests: fix netlink type parsing.

Netlink attribute type field is 2 bytes, not one.

MFC after:	2 weeks
This commit is contained in:
Alexander V. Chernikov 2023-04-18 14:09:47 +00:00
parent af94d8cc17
commit 04a036601e
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ def __init__(self, nla_type, data):
@property
def nla_type(self):
return self._nla_type & 0x3F
return self._nla_type & 0x3FFF
@property
def nla_len(self):

View File

@ -205,7 +205,7 @@ def parse_attrs(self, data: bytes, attr_map):
nla_len, len(data) - off
)
)
nla_type = raw_nla_type & 0x3F
nla_type = raw_nla_type & 0x3FFF
if nla_type in attr_map:
v = attr_map[nla_type]
val = v["ad"].cls.from_bytes(data[off:off + nla_len], v["ad"].val)