git: 04a036601e10 - main - tests: fix netlink type parsing.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 18 Apr 2023 14:10:40 UTC
The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=04a036601e10237ae00655e515aeb78762eb5d1a commit 04a036601e10237ae00655e515aeb78762eb5d1a Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-04-18 14:09:47 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-04-18 14:09:47 +0000 tests: fix netlink type parsing. Netlink attribute type field is 2 bytes, not one. MFC after: 2 weeks --- tests/atf_python/sys/netlink/attrs.py | 2 +- tests/atf_python/sys/netlink/message.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/atf_python/sys/netlink/attrs.py b/tests/atf_python/sys/netlink/attrs.py index 58fbab7fc8db..9769ef0fc76f 100644 --- a/tests/atf_python/sys/netlink/attrs.py +++ b/tests/atf_python/sys/netlink/attrs.py @@ -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): diff --git a/tests/atf_python/sys/netlink/message.py b/tests/atf_python/sys/netlink/message.py index b6fb2f8e357a..1e2b71775102 100644 --- a/tests/atf_python/sys/netlink/message.py +++ b/tests/atf_python/sys/netlink/message.py @@ -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)