tools: ynl: use strerror() if no extack of note provided
Subsystems (3)
Jakub Kicinski
maintainerPATCH 1/1 tools: ynl: use strerror() if no extack of note provided
If kernel didn't give use any meaningful error - print a strerror() to the ynl error message.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- tools/net/ynl/lib/ynl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/net/ynl/lib/ynl.c +5 -1
@@ -145,8 +145,10 @@ ynl_ext_ack_check(struct ynl_sock *ys, const struct nlmsghdr *nlh,const struct nlattr *attr;const char *str =NULL ; -if (!(nlh->nlmsg_flags &NLM_F_ACK_TLVS )) +if (!(nlh->nlmsg_flags &NLM_F_ACK_TLVS )) { +yerr_msg (ys,"%s" ,strerror (ys->err.code));return MNL_CB_OK ; + }mnl_attr_for_each (attr, nlh, hlen) {unsigned int len, type;
@@ -249,6 +251,8 @@ ynl_ext_ack_check(struct ynl_sock *ys, const struct nlmsghdr *nlh,yerr_msg (ys,"Kernel %s: %s%s" , ys->err.code ?"error" :"warning" , bad_attr, miss_attr); + else + yerr_msg(ys, "%s", strerror(ys->err.code));return MNL_CB_OK ; }
Signature · 1 line
2.43.0
Le 02/12/2023 à 22:13, Jakub Kicinski a écrit :
Quoted 4 lines
If kernel didn't give use any meaningful error - print a
strerror()to the ynl error message.Signed-off-by Jakub Kicinski <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Sat, 2 Dec 2023 13:13:10 -0800 you wrote:
If kernel didn't give use any meaningful error - print a
strerror()to the ynl error message.Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected][...]
Here is the summary with links:
- [net-next] tools: ynl: use strerror() if no extack of note provided
https://git.kernel.org/netdev/net-next/c/f2d4d9ad809a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html