netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tools: ynl: use strerror() if no extack of note provided
@ 2023-12-02 21:13 Jakub Kicinski
  2023-12-04  9:16 ` Nicolas Dichtel
  2023-12-06  4:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2023-12-02 21:13 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, jacob.e.keller,
	nicolas.dichtel, jiri

If kernel didn't give use any meaningful error - print
a strerror() to the ynl error message.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: jacob.e.keller@intel.com
CC: nicolas.dichtel@6wind.com
CC: jiri@resnulli.us
---
 tools/net/ynl/lib/ynl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/net/ynl/lib/ynl.c b/tools/net/ynl/lib/ynl.c
index 830d25097009..587286de10b5 100644
--- a/tools/net/ynl/lib/ynl.c
+++ b/tools/net/ynl/lib/ynl.c
@@ -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;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] tools: ynl: use strerror() if no extack of note provided
  2023-12-02 21:13 [PATCH net-next] tools: ynl: use strerror() if no extack of note provided Jakub Kicinski
@ 2023-12-04  9:16 ` Nicolas Dichtel
  2023-12-06  4:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Dichtel @ 2023-12-04  9:16 UTC (permalink / raw)
  To: Jakub Kicinski, davem; +Cc: netdev, edumazet, pabeni, jacob.e.keller, jiri

Le 02/12/2023 à 22:13, Jakub Kicinski a écrit :
> If kernel didn't give use any meaningful error - print
> a strerror() to the ynl error message.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] tools: ynl: use strerror() if no extack of note provided
  2023-12-02 21:13 [PATCH net-next] tools: ynl: use strerror() if no extack of note provided Jakub Kicinski
  2023-12-04  9:16 ` Nicolas Dichtel
@ 2023-12-06  4:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-12-06  4:10 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, netdev, edumazet, pabeni, jacob.e.keller, nicolas.dichtel,
	jiri

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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 <kuba@kernel.org>
> ---
> CC: jacob.e.keller@intel.com
> CC: nicolas.dichtel@6wind.com
> CC: jiri@resnulli.us
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-06  4:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-02 21:13 [PATCH net-next] tools: ynl: use strerror() if no extack of note provided Jakub Kicinski
2023-12-04  9:16 ` Nicolas Dichtel
2023-12-06  4:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).