]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tools: ynl: fix handling of multiple mcast groups
authorJakub Kicinski <kuba@kernel.org>
Mon, 26 Feb 2024 21:40:18 +0000 (13:40 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:48:36 +0000 (14:48 +0000)
commitdbc81b032dd01f23f231486d262d7b1c1bdc9992
tree026eaf98ceb4c3deeb02d0b6b869a1e04e539630
parent80cd0487f630b5382734997c3e5e3003a77db315
tools: ynl: fix handling of multiple mcast groups

[ Upstream commit b6c65eb20ffa8e3bd89f551427dbeee2876d72ca ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/net/ynl/lib/ynl.c