diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 32fa3550..b9ad4fb9 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -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; }