Netdev List
 help / color / mirror / Atom feed
* [PATCH iproute2] ip monitor: Changed 'Unknown message' format to be more informative
@ 2014-09-16 18:23 Vadim Kochan
  2014-09-28 23:15 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Vadim Kochan @ 2014-09-16 18:23 UTC (permalink / raw)
  To: netdev; +Cc: Vadim Kochan

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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index 70f2a7a..838934d 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -135,8 +135,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;
 }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-28 23:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-16 18:23 [PATCH iproute2] ip monitor: Changed 'Unknown message' format to be more informative Vadim Kochan
2014-09-28 23:15 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox