git: 9a8ea61a14fc - stable/13 - tests: fix python parsing of netlink nested attributes
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 08 Apr 2023 19:45:06 UTC
The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=9a8ea61a14fc698092370eff87f9723abc7dfc84 commit 9a8ea61a14fc698092370eff87f9723abc7dfc84 Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-03-13 10:17:36 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-04-08 19:18:47 +0000 tests: fix python parsing of netlink nested attributes MFC after: 2 weeks (cherry picked from commit 90bc2120b51bc5ac9fbcb29763cc47562ee49977) --- tests/atf_python/sys/net/netlink.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/atf_python/sys/net/netlink.py b/tests/atf_python/sys/net/netlink.py index bfbf3217d52a..053eb432e915 100644 --- a/tests/atf_python/sys/net/netlink.py +++ b/tests/atf_python/sys/net/netlink.py @@ -1082,6 +1082,7 @@ rtnl_ifla_attrs = prepare_attrs_map( AttrDescr(IflattrType.IFLA_BROADCAST, NlAttrMac), AttrDescr(IflattrType.IFLA_IFNAME, NlAttrStr), AttrDescr(IflattrType.IFLA_MTU, NlAttrU32), + AttrDescr(IflattrType.IFLA_LINK, NlAttrU32), AttrDescr(IflattrType.IFLA_PROMISCUITY, NlAttrU32), AttrDescr(IflattrType.IFLA_OPERSTATE, NlAttrU8), AttrDescr(IflattrType.IFLA_CARRIER, NlAttrU8), @@ -1279,8 +1280,8 @@ class StdNetlinkMessage(BaseNetlinkMessage): val = v["ad"].cls.from_bytes(data[off : off + nla_len], v["ad"].val) if "child" in v: # nested - attrs, _ = self.parse_attrs(data[off : off + nla_len], v["child"]) - val = NlAttrNested(raw_nla_type, attrs) + attrs, _ = self.parse_attrs(data[off + 4 : off + nla_len], v["child"]) + val = NlAttrNested(v["ad"].val, attrs) else: # unknown attribute val = NlAttr(raw_nla_type, data[off + 4 : off + nla_len])