Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH net] ethtool: fix missing NLM_F_MULTI flag when dumping
@ 2021-05-04 22:47 Fernando Fernandez Mancera
  2021-05-05 19:50 ` patchwork-bot+netdevbpf
  2021-05-05 21:09 ` Michal Kubecek
  0 siblings, 2 replies; 3+ messages in thread
From: Fernando Fernandez Mancera @ 2021-05-04 22:47 UTC (permalink / raw)
  To: netdev, mkubecek, atenart; +Cc: Fernando Fernandez Mancera

When dumping the ethtool information from all the interfaces, the
netlink reply should contain the NLM_F_MULTI flag. This flag allows
userspace tools to identify that multiple messages are expected.

Link: https://bugzilla.redhat.com/1953847
Fixes: 365f9ae ("ethtool: fix genlmsg_put() failure handling in ethnl_default_dumpit()")
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
---
 net/ethtool/netlink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
index 290012d0d11d..88d8a0243f35 100644
--- a/net/ethtool/netlink.c
+++ b/net/ethtool/netlink.c
@@ -387,7 +387,8 @@ static int ethnl_default_dump_one(struct sk_buff *skb, struct net_device *dev,
 	int ret;
 
 	ehdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
-			   &ethtool_genl_family, 0, ctx->ops->reply_cmd);
+			   &ethtool_genl_family, NLM_F_MULTI,
+			   ctx->ops->reply_cmd);
 	if (!ehdr)
 		return -EMSGSIZE;
 
-- 
2.20.1


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

* Re: [PATCH net] ethtool: fix missing NLM_F_MULTI flag when dumping
  2021-05-04 22:47 [PATCH net] ethtool: fix missing NLM_F_MULTI flag when dumping Fernando Fernandez Mancera
@ 2021-05-05 19:50 ` patchwork-bot+netdevbpf
  2021-05-05 21:09 ` Michal Kubecek
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-05 19:50 UTC (permalink / raw)
  To: Fernando Fernandez Mancera; +Cc: netdev, mkubecek, atenart

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed,  5 May 2021 00:47:14 +0200 you wrote:
> When dumping the ethtool information from all the interfaces, the
> netlink reply should contain the NLM_F_MULTI flag. This flag allows
> userspace tools to identify that multiple messages are expected.
> 
> Link: https://bugzilla.redhat.com/1953847
> Fixes: 365f9ae ("ethtool: fix genlmsg_put() failure handling in ethnl_default_dumpit()")
> Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
> 
> [...]

Here is the summary with links:
  - [net] ethtool: fix missing NLM_F_MULTI flag when dumping
    https://git.kernel.org/netdev/net/c/cf754ae331be

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] 3+ messages in thread

* Re: [PATCH net] ethtool: fix missing NLM_F_MULTI flag when dumping
  2021-05-04 22:47 [PATCH net] ethtool: fix missing NLM_F_MULTI flag when dumping Fernando Fernandez Mancera
  2021-05-05 19:50 ` patchwork-bot+netdevbpf
@ 2021-05-05 21:09 ` Michal Kubecek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Kubecek @ 2021-05-05 21:09 UTC (permalink / raw)
  To: Fernando Fernandez Mancera; +Cc: netdev, atenart

On Wed, May 05, 2021 at 12:47:14AM +0200, Fernando Fernandez Mancera wrote:
> When dumping the ethtool information from all the interfaces, the
> netlink reply should contain the NLM_F_MULTI flag. This flag allows
> userspace tools to identify that multiple messages are expected.
> 
> Link: https://bugzilla.redhat.com/1953847
> Fixes: 365f9ae ("ethtool: fix genlmsg_put() failure handling in ethnl_default_dumpit()")

For the record, the issue was not introduced by this commit, this commit
only moved the genlmsg_put() call from ethnl_default_dumpit() into
ethnl_default_dump_one() but genlmsg_put() was called with zero flags
since the code was introduced by commit 728480f12442 ("ethtool: default
handlers for GET requests").

But as the patch has been applied already, it doesn't matter any more.

Michal

> Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
> ---
>  net/ethtool/netlink.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
> index 290012d0d11d..88d8a0243f35 100644
> --- a/net/ethtool/netlink.c
> +++ b/net/ethtool/netlink.c
> @@ -387,7 +387,8 @@ static int ethnl_default_dump_one(struct sk_buff *skb, struct net_device *dev,
>  	int ret;
>  
>  	ehdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
> -			   &ethtool_genl_family, 0, ctx->ops->reply_cmd);
> +			   &ethtool_genl_family, NLM_F_MULTI,
> +			   ctx->ops->reply_cmd);
>  	if (!ehdr)
>  		return -EMSGSIZE;
>  
> -- 
> 2.20.1
> 

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 22:47 [PATCH net] ethtool: fix missing NLM_F_MULTI flag when dumping Fernando Fernandez Mancera
2021-05-05 19:50 ` patchwork-bot+netdevbpf
2021-05-05 21:09 ` Michal Kubecek

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git