From: Donald Sharp Date: Thu, 11 May 2017 15:44:07 +0000 (-0400) Subject: zebra: Fix kernel netlink hex dump of information X-Git-Tag: reindent-master-before~177^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=64a4bd09f0704eff92fdcbcede20662f46ab0c42;p=matthieu%2Ffrr.git zebra: Fix kernel netlink hex dump of information 1) Fix the kernel send and recv hex dump of what we are sending to the kernel 2) When configuring the debugs under 'conf t' display it too. Signed-off-by: Donald Sharp --- diff --git a/zebra/debug.c b/zebra/debug.c index a42d5aa3ef..cb1ed359a8 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -384,6 +384,16 @@ config_write_debug (struct vty *vty) vty_out (vty, "debug zebra kernel%s", VTY_NEWLINE); write++; } + if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) + { + vty_out (vty, "debug zebra kernel msgdump recv%s", VTY_NEWLINE); + write++; + } + if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) + { + vty_out (vty, "debug zebra kernel msgdump send%s", VTY_NEWLINE); + write++; + } /* Check here using flags as the 'macro' does an OR */ if (CHECK_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB)) { diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 763cd4adda..27beaf0c82 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -522,7 +522,7 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *, if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) { zlog_debug("%s: << netlink message dump [recv]", __func__); - zlog_hexdump(&msg, sizeof(msg)); + zlog_hexdump(buf, status); } read_in++; @@ -705,7 +705,7 @@ netlink_talk (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *, if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) { zlog_debug("%s: >> netlink message dump [sent]", __func__); - zlog_hexdump(&msg, sizeof(msg)); + zlog_hexdump(n, n->nlmsg_len); } if (status < 0)