]> git.ipfire.org Git - thirdparty/linux.git/commit
tools: ynl-gen: mutli-attr: support binary types with struct
authorJakub Kicinski <kuba@kernel.org>
Tue, 29 Apr 2025 15:47:00 +0000 (08:47 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Fri, 2 May 2025 10:41:02 +0000 (12:41 +0200)
commit3456084d6361f4c835b73a0bce04fa5894bf9c65
tree8a5db841e6974ac3e39a6100255a6ee4ca02a008
parent0ea8cf56cc20ed51cfbef7c6410874ac7fd07642
tools: ynl-gen: mutli-attr: support binary types with struct

Binary types with struct are fixed size, relatively easy to
handle for multi attr. Declare the member as a pointer.
Count the members, allocate an array, copy in the data.
Allow the netlink attr to be smaller or larger than our view
of the struct in case the build headers are newer or older
than the running kernel.

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250429154704.2613851-9-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/net/ynl/pyynl/ynl_gen_c.py