The branch main has been updated by melifaro:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=90bc2120b51bc5ac9fbcb29763cc47562ee49977

commit 90bc2120b51bc5ac9fbcb29763cc47562ee49977
Author:     Alexander V. Chernikov <[email protected]>
AuthorDate: 2023-03-13 10:17:36 +0000
Commit:     Alexander V. Chernikov <[email protected]>
CommitDate: 2023-03-13 10:17:36 +0000

    tests: fix python parsing of netlink nested attributes
    
    MFC after:      2 weeks
---
 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])

Reply via email to