mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 22:54:01 +00:00
tools: ynl: don't ignore errors in NLMSG_DONE messages
[ Upstream commita44f2eb106
] 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:e4b48ed460
("tools: ynl: add a completely generic client") Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://lore.kernel.org/r/20240420020827.3288615-1-kuba@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4fee8fa86a
commit
6a65f015ee
1 changed files with 1 additions and 0 deletions
|
@ -201,6 +201,7 @@ class NlMsg:
|
||||||
self.done = 1
|
self.done = 1
|
||||||
extack_off = 20
|
extack_off = 20
|
||||||
elif self.nl_type == Netlink.NLMSG_DONE:
|
elif self.nl_type == Netlink.NLMSG_DONE:
|
||||||
|
self.error = struct.unpack("i", self.raw[0:4])[0]
|
||||||
self.done = 1
|
self.done = 1
|
||||||
extack_off = 4
|
extack_off = 4
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue