diff mbox series

[net] ethtool: fix missing NLM_F_MULTI flag when dumping

Message ID 20210504224714.7632-1-ffmancera@riseup.net (mailing list archive)
State Accepted
Commit cf754ae331be7cc192b951756a1dd031e9ed978a
Delegated to: Netdev Maintainers
Headers show
Series [net] ethtool: fix missing NLM_F_MULTI flag when dumping | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers fail 2 blamed authors not CCed: davem@davemloft.net kuba@kernel.org; 5 maintainers not CCed: vladyslavt@nvidia.com andrew@lunn.ch johannes.berg@intel.com davem@davemloft.net kuba@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 1 this patch: 1
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes fail Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 1
netdev/header_inline success Link

Commit Message

Fernando F. Mancera May 4, 2021, 10:47 p.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org May 5, 2021, 7:50 p.m. UTC | #1
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
Michal Kubecek May 5, 2021, 9:09 p.m. UTC | #2
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
>
diff mbox series

Patch

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;