3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-04 02:18:49 +02:00

monitor: Fix printing of netlink error codes

This commit is contained in:
Marcel Holtmann 2014-08-09 19:22:19 -07:00
parent 7689d2202f
commit 8c5de4fd1f

View File

@ -928,10 +928,10 @@ static void print_message(const struct nlmsghdr *nlmsg)
NLMSG_PAYLOAD(nlmsg, 0));
if (nlmsg->nlmsg_type == NLMSG_ERROR) {
uint32_t status = *((uint32_t *) NLMSG_DATA(nlmsg));
struct nlmsgerr *err = NLMSG_DATA(nlmsg);
printf("%*cStatus: %s (%u)\n", 4, ' ',
strerror(status), status);
printf("%*cStatus: %s (%d)\n", 4, ' ',
strerror(-err->error), -err->error);
print_hexdump(NLMSG_DATA(nlmsg) + 4,
NLMSG_PAYLOAD(nlmsg, 4));
} else