diff options
author | Jakub Kicinski <kuba@kernel.org> | 2024-02-27 00:40:18 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-02-29 02:24:34 +0300 |
commit | b6c65eb20ffa8e3bd89f551427dbeee2876d72ca (patch) | |
tree | 74e06993edd7a30d8838958972572644cfe03c7a /tools | |
parent | 4adfc94d4aeca1177e1188ba83c20ed581523fe1 (diff) | |
download | linux-b6c65eb20ffa8e3bd89f551427dbeee2876d72ca.tar.xz |
tools: ynl: fix handling of multiple mcast groups
We never increment the group number iterator, so all groups
get recorded into index 0 of the mcast_groups[] array.
As a result YNL can only handle using the last group.
For example using the "netdev" sample on kernel with
page pool commands results in:
$ ./samples/netdev
YNL: Multicast group 'mgmt' not found
Most families have only one multicast group, so this hasn't
been noticed. Plus perhaps developers usually test the last
group which would have worked.
Fixes: 86878f14d71a ("tools: ynl: user space helpers")
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/20240226214019.1255242-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/net/ynl/lib/ynl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/net/ynl/lib/ynl.c b/tools/net/ynl/lib/ynl.c index 6e6d474c8366..45e49671ae87 100644 --- a/tools/net/ynl/lib/ynl.c +++ b/tools/net/ynl/lib/ynl.c @@ -523,6 +523,7 @@ ynl_get_family_info_mcast(struct ynl_sock *ys, const struct nlattr *mcasts) ys->mcast_groups[i].name[GENL_NAMSIZ - 1] = 0; } } + i++; } return 0; |