]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip monitor: Changed 'Unknown message' format to be more informative
authorvadimk <vadim4j@gmail.com>
Mon, 29 Sep 2014 20:07:57 +0000 (23:07 +0300)
committerStephen Hemminger <shemming@brocade.com>
Thu, 9 Oct 2014 15:24:00 +0000 (08:24 -0700)
In case if unknown message was handled then it will be displayed as:

    Unknown message: type=0x00000044(68) flags=0x00000000(0) len=0x0000004c(76)

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
ip/ipmonitor.c

index 088ec54674361fb5728343a5e918c68eccfb6cbe..b7b2d98d80fe9a16dd350bfe511e8ac69846d46b 100644 (file)
@@ -143,8 +143,10 @@ static int accept_msg(const struct sockaddr_nl *who,
                return 0;
        if (n->nlmsg_type != NLMSG_ERROR && n->nlmsg_type != NLMSG_NOOP &&
            n->nlmsg_type != NLMSG_DONE) {
-               fprintf(fp, "Unknown message: %08x %08x %08x\n",
-                       n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags);
+               fprintf(fp, "Unknown message: type=0x%08x(%d) flags=0x%08x(%d)"
+                       "len=0x%08x(%d)\n", n->nlmsg_type, n->nlmsg_type,
+                       n->nlmsg_flags, n->nlmsg_flags, n->nlmsg_len,
+                       n->nlmsg_len);
        }
        return 0;
 }