mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-16 23:40:43 +01:00
monitor: Print netlink command complete error messages
This commit is contained in:
parent
1219658f7d
commit
7689d2202f
@ -908,7 +908,7 @@ static void print_message(const struct nlmsghdr *nlmsg)
|
|||||||
str = "Noop";
|
str = "Noop";
|
||||||
break;
|
break;
|
||||||
case NLMSG_ERROR:
|
case NLMSG_ERROR:
|
||||||
str = "Error";
|
str = "Complete";
|
||||||
break;
|
break;
|
||||||
case NLMSG_DONE:
|
case NLMSG_DONE:
|
||||||
str = "Done";
|
str = "Done";
|
||||||
@ -926,6 +926,17 @@ static void print_message(const struct nlmsghdr *nlmsg)
|
|||||||
nlmsg->nlmsg_type,
|
nlmsg->nlmsg_type,
|
||||||
nlmsg->nlmsg_flags,
|
nlmsg->nlmsg_flags,
|
||||||
NLMSG_PAYLOAD(nlmsg, 0));
|
NLMSG_PAYLOAD(nlmsg, 0));
|
||||||
|
|
||||||
|
if (nlmsg->nlmsg_type == NLMSG_ERROR) {
|
||||||
|
uint32_t status = *((uint32_t *) NLMSG_DATA(nlmsg));
|
||||||
|
|
||||||
|
printf("%*cStatus: %s (%u)\n", 4, ' ',
|
||||||
|
strerror(status), status);
|
||||||
|
print_hexdump(NLMSG_DATA(nlmsg) + 4,
|
||||||
|
NLMSG_PAYLOAD(nlmsg, 4));
|
||||||
|
} else
|
||||||
|
print_hexdump(NLMSG_DATA(nlmsg),
|
||||||
|
NLMSG_PAYLOAD(nlmsg, 0));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user