ethtool: fix missing NLM_F_MULTI flag when dumping
Subsystems (3)
PATCH 1/1 ethtool: fix missing NLM_F_MULTI flag when dumping
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.
--- net/ethtool/netlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ethtool/netlink.c +2 -1
@@ -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, - ðtool_genl_family,0 , ctx->ops->reply_cmd); + ðtool_genl_family,NLM_F_MULTI , + ctx->ops->reply_cmd);if (!ehdr)return -EMSGSIZE ;
Signature · 1 line
2.20.1
This patch was applied to netdev/net.git (refs/heads/master):
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
Quoted 9 lines · 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_MULTIflag. This flag allows userspace tools to identify that multiple messages are expected.Fixes 365f9ae ("ethtool: fix genlmsg_put() failure handling in ethnl_default_dumpit()")Signed-off-by Fernando Fernandez Mancera <[email protected]>[...]
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
Quoted 6 lines · Fernando Fernandez Mancera
When dumping the ethtool information from all the interfaces, the netlink reply should contain the
NLM_F_MULTIflag. This flag allows userspace tools to identify that multiple messages are expected.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
Quoted 22 lines
Signed-off-by Fernando Fernandez Mancera <[email protected]>--- net/ethtool/netlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/ethtool/netlink.c +2
-1@@ -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, - ðtool_genl_family,0 , ctx->ops->reply_cmd); + ðtool_genl_family,NLM_F_MULTI , + ctx->ops->reply_cmd);if (!ehdr)return -EMSGSIZE ;Signature · 1 line
2.20.1