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 committed 2023-04-18 14:09:47 +00:00
1 parent af94d8cc17
commit 04a036601e
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ class NlAttr(object):
@property
def nla_type(self):
return self._nla_type & 0x3F
return self._nla_type & 0x3FFF
@property
def nla_len(self):
+1 -1
View File
@@ -205,7 +205,7 @@ class StdNetlinkMessage(BaseNetlinkMessage):
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)