[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m21q6xha6j.fsf@gmail.com>
Date: Mon, 22 Apr 2024 13:08:20 +0100
From: Donald Hunter <donald.hunter@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, jiri@...nulli.us, sdf@...gle.com
Subject: Re: [PATCH net] tools: ynl: don't ignore errors in NLMSG_DONE messages
Jakub Kicinski <kuba@...nel.org> writes:
> NLMSG_DONE contains an error code, it has to be extracted.
> Prior to this change all dumps will end in success,
> and in case of failure the result is silently truncated.
>
> Fixes: e4b48ed460d3 ("tools: ynl: add a completely generic client")
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Reviewed-by: Donald Hunter <donald.hunter@...il.com>
> ---
> CC: donald.hunter@...il.com
> CC: jiri@...nulli.us
> CC: sdf@...gle.com
> ---
> tools/net/ynl/lib/ynl.py | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
> index a67f7b6fef92..a9e4d588baf6 100644
> --- a/tools/net/ynl/lib/ynl.py
> +++ b/tools/net/ynl/lib/ynl.py
> @@ -203,6 +203,7 @@ from .nlspec import SpecFamily
> self.done = 1
> extack_off = 20
> elif self.nl_type == Netlink.NLMSG_DONE:
> + self.error = struct.unpack("i", self.raw[0:4])[0]
> self.done = 1
> extack_off = 4
Powered by blists - more mailing lists