]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tools/net/ynl: fix sub-message key lookup for nested attributes
authorDonald Hunter <donald.hunter@gmail.com>
Fri, 13 Dec 2024 13:07:11 +0000 (13:07 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:02:02 +0000 (14:02 +0100)
commit1c2d7999d152900013a73fd952e854022f87d838
tree2f4b3512f2d3c6d7360dd2a739efd3fbe599bdfd
parent8e9ef6bdf71bf25f4735e0230ce1919de8985835
tools/net/ynl: fix sub-message key lookup for nested attributes

[ Upstream commit 663ad7481f068057f6f692c5368c47150e855370 ]

Use the correct attribute space for sub-message key lookup in nested
attributes when adding attributes. This fixes rt_link where the "kind"
key and "data" sub-message are nested attributes in "linkinfo".

For example:

./tools/net/ynl/cli.py \
    --create \
    --spec Documentation/netlink/specs/rt_link.yaml \
    --do newlink \
    --json '{"link": 99,
             "linkinfo": { "kind": "vlan", "data": {"id": 4 } }
             }'

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Fixes: ab463c4342d1 ("tools/net/ynl: Add support for encoding sub-messages")
Link: https://patch.msgid.link/20241213130711.40267-1-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/net/ynl/lib/ynl.py