]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ethtool: fix missing NLM_F_MULTI flag when dumping
authorFernando Fernandez Mancera <ffmancera@riseup.net>
Tue, 4 May 2021 22:47:14 +0000 (00:47 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 18 Jun 2021 09:07:20 +0000 (11:07 +0200)
BugLink: https://bugs.launchpad.net/bugs/1931292
[ Upstream commit cf754ae331be7cc192b951756a1dd031e9ed978a ]

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: 365f9ae4ee36 ("ethtool: fix genlmsg_put() failure handling in ethnl_default_dumpit()")
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/ethtool/netlink.c

index 50d3c8896f917b7403ca1b48802eb08ca16d51b8..25a55086d2b66a093a20538cd4728b2d00d39ca6 100644 (file)
@@ -384,7 +384,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;