mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-24 15:22:34 +01:00
monitor: Fix printing of netlink error codes
This commit is contained in:
parent
7689d2202f
commit
8c5de4fd1f
@ -928,10 +928,10 @@ static void print_message(const struct nlmsghdr *nlmsg)
|
|||||||
NLMSG_PAYLOAD(nlmsg, 0));
|
NLMSG_PAYLOAD(nlmsg, 0));
|
||||||
|
|
||||||
if (nlmsg->nlmsg_type == NLMSG_ERROR) {
|
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, ' ',
|
printf("%*cStatus: %s (%d)\n", 4, ' ',
|
||||||
strerror(status), status);
|
strerror(-err->error), -err->error);
|
||||||
print_hexdump(NLMSG_DATA(nlmsg) + 4,
|
print_hexdump(NLMSG_DATA(nlmsg) + 4,
|
||||||
NLMSG_PAYLOAD(nlmsg, 4));
|
NLMSG_PAYLOAD(nlmsg, 4));
|
||||||
} else
|
} else
|
||||||
|
Loading…
Reference in New Issue
Block a user