tests: fix netlink type parsing.
Netlink attribute type field is 2 bytes, not one. MFC after: 2 weeks
This commit is contained in:
parent
af94d8cc17
commit
04a036601e
@ -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):
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user