The current code doesn't set errno in case of extended ack.
Fixes: 049c58539f5d ("devlink: mnlg: Add support for extended ack")
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
{
const struct nlmsgerr *err = mnl_nlmsg_get_payload(nlh);
- if (nl_dump_ext_ack(nlh, NULL))
- return MNL_CB_STOP;
-
/* Netlink subsystems returns the errno value with different signess */
if (err->error < 0)
errno = -err->error;
else
errno = err->error;
+ if (nl_dump_ext_ack(nlh, NULL))
+ return MNL_CB_ERROR;
+
return err->error == 0 ? MNL_CB_STOP : MNL_CB_ERROR;
}