Skip to content

Commit a44f2eb

Browse files
kuba-mooPaolo Abeni
authored andcommitted
tools: ynl: don't ignore errors in NLMSG_DONE messages
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: e4b48ed ("tools: ynl: add a completely generic client") Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Donald Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 467324b commit a44f2eb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/net/ynl/lib/ynl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def __init__(self, msg, offset, attr_space=None):
182182
self.done = 1
183183
extack_off = 20
184184
elif self.nl_type == Netlink.NLMSG_DONE:
185+
self.error = struct.unpack("i", self.raw[0:4])[0]
185186
self.done = 1
186187
extack_off = 4
187188

0 commit comments

Comments
 (0)