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";
|
||||
break;
|
||||
case NLMSG_ERROR:
|
||||
str = "Error";
|
||||
str = "Complete";
|
||||
break;
|
||||
case NLMSG_DONE:
|
||||
str = "Done";
|
||||
|
@ -926,6 +926,17 @@ static void print_message(const struct nlmsghdr *nlmsg)
|
|||
nlmsg->nlmsg_type,
|
||||
nlmsg->nlmsg_flags,
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue