a702e988 | 20-Feb-2024 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: don't leak mcast_groups on init error
[ Upstream commit 5d78b73e851455d525a064f3b042b29fdc0c1a4a ]
Make sure to free the already-parsed mcast_groups if we don't get an ack from the kern
tools: ynl: don't leak mcast_groups on init error
[ Upstream commit 5d78b73e851455d525a064f3b042b29fdc0c1a4a ]
Make sure to free the already-parsed mcast_groups if we don't get an ack from the kernel when reading family info. This is part of the ynl_sock_create() error path, so we won't get a call to ynl_sock_destroy() to free them later.
Fixes: 86878f14d71a ("tools: ynl: user space helpers") Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Link: https://lore.kernel.org/r/20240220161112.2735195-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
1768d8a7 | 25-Aug-2023 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: Add support for create flags
Add support for using NLM_F_REPLACE, _EXCL, _CREATE and _APPEND flags in requests.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Ja
tools/net/ynl: Add support for create flags
Add support for using NLM_F_REPLACE, _EXCL, _CREATE and _APPEND flags in requests.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20230825122756.7603-10-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
0493e56d | 25-Aug-2023 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: Implement nlattr array-nest decoding in ynl
Add support for the 'array-nest' attribute type that is used by several netlink-raw families.
Signed-off-by: Donald Hunter <donald.hunter@
tools/net/ynl: Implement nlattr array-nest decoding in ynl
Add support for the 'array-nest' attribute type that is used by several netlink-raw families.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20230825122756.7603-9-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
e46dd903 | 25-Aug-2023 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: Add support for netlink-raw families
Refactor the ynl code to encapsulate protocol specifics into NetlinkProtocol and GenlProtocol.
Signed-off-by: Donald Hunter <donald.hunter@gmail.
tools/net/ynl: Add support for netlink-raw families
Refactor the ynl code to encapsulate protocol specifics into NetlinkProtocol and GenlProtocol.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://lore.kernel.org/r/20230825122756.7603-8-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
fb0a06d4 | 25-Aug-2023 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: Fix extack parsing with fixed header genlmsg
Move decode_fixed_header into YnlFamily and add a _fixed_header_size method to allow extack decoding to skip the fixed header.
Signed-off
tools/net/ynl: Fix extack parsing with fixed header genlmsg
Move decode_fixed_header into YnlFamily and add a _fixed_header_size method to allow extack decoding to skip the fixed header.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20230825122756.7603-7-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
df15c15e | 25-Jul-2023 |
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> |
tools: ynl-gen: fix parse multi-attr enum attribute
When attribute is enum type and marked as multi-attr, the netlink respond is not parsed, fails with stack trace: Traceback (most recent call last)
tools: ynl-gen: fix parse multi-attr enum attribute
When attribute is enum type and marked as multi-attr, the netlink respond is not parsed, fails with stack trace: Traceback (most recent call last): File "/net-next/tools/net/ynl/./test.py", line 520, in <module> main() File "/net-next/tools/net/ynl/./test.py", line 488, in main dplls=dplls_get(282574471561216) File "/net-next/tools/net/ynl/./test.py", line 48, in dplls_get reply=act(args) File "/net-next/tools/net/ynl/./test.py", line 41, in act reply = ynl.dump(args.dump, attrs) File "/net-next/tools/net/ynl/lib/ynl.py", line 598, in dump return self._op(method, vals, dump=True) File "/net-next/tools/net/ynl/lib/ynl.py", line 584, in _op rsp_msg = self._decode(gm.raw_attrs, op.attr_set.name) File "/net-next/tools/net/ynl/lib/ynl.py", line 451, in _decode self._decode_enum(rsp, attr_spec) File "/net-next/tools/net/ynl/lib/ynl.py", line 408, in _decode_enum value = enum.entries_by_val[raw].name TypeError: unhashable type: 'list' error: 1
Redesign _decode_enum(..) to take a enum int value and translate it to either a bitmask or enum name as expected.
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://lore.kernel.org/r/20230725101642.267248-3-arkadiusz.kubalewski@intel.com Reviewed-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
6da3424f | 08-Jun-2023 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl-gen: support code gen for events
Netlink specs support both events and notifications (former can define their own message contents). Plug in missing code to generate types, parsers and in
tools: ynl-gen: support code gen for events
Netlink specs support both events and notifications (former can define their own message contents). Plug in missing code to generate types, parsers and include events into notification tables.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
bddd2e56 | 23-May-2023 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl: Handle byte-order in struct members
Add support for byte-order in struct members in the genetlink-legacy spec.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Acked-by: Jakub Kic
tools: ynl: Handle byte-order in struct members
Add support for byte-order in struct members in the genetlink-legacy spec.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|