[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240226214019.1255242-1-kuba@kernel.org>
Date: Mon, 26 Feb 2024 13:40:18 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
Jakub Kicinski <kuba@...nel.org>,
nicolas.dichtel@...nd.com,
willemb@...gle.com
Subject: [PATCH net] 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")
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
CC: nicolas.dichtel@...nd.com
CC: willemb@...gle.com
---
tools/net/ynl/lib/ynl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/net/ynl/lib/ynl.c b/tools/net/ynl/lib/ynl.c
index c2ba72f68028..6bc95f07dc8f 100644
--- a/tools/net/ynl/lib/ynl.c
+++ b/tools/net/ynl/lib/ynl.c
@@ -585,6 +585,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;
--
2.43.2
Powered by blists - more mailing lists