netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] tools: ynl: fix handling of multiple mcast groups
@ 2024-02-26 21:40 Jakub Kicinski
  2024-02-27 13:35 ` Donald Hunter
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jakub Kicinski @ 2024-02-26 21:40 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, nicolas.dichtel, willemb

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@kernel.org>
---
CC: nicolas.dichtel@6wind.com
CC: willemb@google.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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tools: ynl: fix handling of multiple mcast groups
  2024-02-26 21:40 [PATCH net] tools: ynl: fix handling of multiple mcast groups Jakub Kicinski
@ 2024-02-27 13:35 ` Donald Hunter
  2024-02-27 16:41 ` Nicolas Dichtel
  2024-02-28 23:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Donald Hunter @ 2024-02-27 13:35 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, nicolas.dichtel, willemb

Jakub Kicinski <kuba@kernel.org> writes:

> 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@kernel.org>

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tools: ynl: fix handling of multiple mcast groups
  2024-02-26 21:40 [PATCH net] tools: ynl: fix handling of multiple mcast groups Jakub Kicinski
  2024-02-27 13:35 ` Donald Hunter
@ 2024-02-27 16:41 ` Nicolas Dichtel
  2024-02-28 23:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolas Dichtel @ 2024-02-27 16:41 UTC (permalink / raw)
  To: Jakub Kicinski, davem; +Cc: netdev, edumazet, pabeni, willemb

Le 26/02/2024 à 22:40, Jakub Kicinski a écrit :
> 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@kernel.org>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] tools: ynl: fix handling of multiple mcast groups
  2024-02-26 21:40 [PATCH net] tools: ynl: fix handling of multiple mcast groups Jakub Kicinski
  2024-02-27 13:35 ` Donald Hunter
  2024-02-27 16:41 ` Nicolas Dichtel
@ 2024-02-28 23:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-28 23:50 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, nicolas.dichtel, willemb

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 26 Feb 2024 13:40:18 -0800 you wrote:
> 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:
> 
> [...]

Here is the summary with links:
  - [net] tools: ynl: fix handling of multiple mcast groups
    https://git.kernel.org/netdev/net/c/b6c65eb20ffa

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-28 23:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-26 21:40 [PATCH net] tools: ynl: fix handling of multiple mcast groups Jakub Kicinski
2024-02-27 13:35 ` Donald Hunter
2024-02-27 16:41 ` Nicolas Dichtel
2024-02-28 23:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).