netdev-genl: avoid empty messages in queue dump
Subsystems (2)
Jakub Kicinski
maintainerPATCH 1/1 netdev-genl: avoid empty messages in queue dump
Empty netlink responses from do() are not correct (as opposed to dump() where not dumping anything is perfectly fine). We should return an error if the target object does not exist, in this case if the netdev is down it has no queues.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- net/core/netdev-genl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/netdev-genl.c +2 -2
@@ -430,10 +430,10 @@ static int netdev_nl_queue_fill(struct sk_buff *rsp, struct net_device *netdev, u32 q_idx, u32 q_type, const struct genl_info *info) { - int err = 0; + int err;if (!(netdev->flags &IFF_UP )) -return err; +return -ENOENT ; err =netdev_nl_queue_validate (netdev, q_idx, q_type);if (err)
Signature · 1 line
2.47.1
Jakub Kicinski
maintainerQuoted 4 lines · On Tue, 17 Dec 2024 18:25:08 -0800 Jakub Kicinski wrote:
Subject: [PATCH net] netdev-genl: avoid empty messages in queue dump
Empty netlink responses from
do()are not correct (as opposed todump()where not dumping anything is perfectly fine).
Well.. I shouldn't have said "dump" in the subject, then. Let's see how the review goes, I can adjust when applying.
Quoted 9 lines · Jakub Kicinski
Empty netlink responses from
do()are not correct (as opposed todump()where not dumping anything is perfectly fine). We should return an error if the target object does not exist, in this case if the netdev is down it has no queues.Fixes 6b6171db7fc8 ("netdev-genl: Add netlink framework functions for queue")Reported-by [email protected]Signed-off-by Jakub Kicinski <[email protected]>
Quoted 24 lines · Jakub Kicinski
Empty netlink responses from
do()are not correct (as opposed todump()where not dumping anything is perfectly fine). We should return an error if the target object does not exist, in this case if the netdev is down it has no queues.Fixes 6b6171db7fc8 ("netdev-genl: Add netlink framework functions for queue")Reported-by [email protected]Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]--- net/core/netdev-genl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)net/core/netdev-genl.c +0
-0@@ -430,10 +430,10 @@ static int netdev_nl_queue_fill(struct sk_buff *rsp, struct net_device *netdev, u32 q_idx, u32 q_type, const struct genl_info *info)
net/core/netdev-genl.c static int · line 439
Quoted 10 lines
net/core/netdev-genl.c +2
-2{ -int err =0 ; +int err;if (!(netdev->flags &IFF_UP )) -return err; +return -ENOENT ; err =netdev_nl_queue_validate (netdev, q_idx, q_type);if (err)
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Tue, 17 Dec 2024 18:25:08 -0800 you wrote:
Empty netlink responses from
do()are not correct (as opposed todump()where not dumping anything is perfectly fine). We should return an error if the target object does not exist, in this case if the netdev is down it has no queues.Fixes 6b6171db7fc8 ("netdev-genl: Add netlink framework functions for queue")Reported-by [email protected]Signed-off-by Jakub Kicinski <[email protected]>[...]
Here is the summary with links:
- [net] netdev-genl: avoid empty messages in queue dump
https://git.kernel.org/netdev/net/c/5eb70dbebf32
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html