summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-02-26 13:40:18 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-06 14:53:51 +0000
commit5847f9a493ba39efcc626e6af43708d6a85ab026 (patch)
tree03df02d21f5487fddf9d0411f29b6780387a3ef9 /tools
parentcb734975b0ffa688ff6cc0eed463865bf07b6c01 (diff)
downloadlinux-stable-5847f9a493ba39efcc626e6af43708d6a85ab026.tar.gz
linux-stable-5847f9a493ba39efcc626e6af43708d6a85ab026.tar.bz2
linux-stable-5847f9a493ba39efcc626e6af43708d6a85ab026.zip
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/net/ynl/lib/ynl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/net/ynl/lib/ynl.c b/tools/net/ynl/lib/ynl.c
index 591f5f50ddaa..2aa19004fa0c 100644
--- a/tools/net/ynl/lib/ynl.c
+++ b/tools/net/ynl/lib/ynl.c
@@ -519,6 +519,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;