summaryrefslogtreecommitdiff
path: root/zebra/kernel_netlink.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@nvidia.com>2020-12-14 14:03:35 -0500
committerGitHub <noreply@github.com>2020-12-14 14:03:35 -0500
commit3bece1e0e399c01d95743cd2fe2ae7d20ecbbfc7 (patch)
tree87137de2f86802ce1b1b0d8bf20d918b634a4d05 /zebra/kernel_netlink.c
parentc2dba6e5b80e63149e5c65609d32cd22d883b23c (diff)
parenteead0bc46b9ba49f49a4c2939c89e74b3266b452 (diff)
Merge pull request #7162 from opensourcerouting/zebra-human-netlink
zebra: human readable netlink dumps
Diffstat (limited to 'zebra/kernel_netlink.c')
-rw-r--r--zebra/kernel_netlink.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c
index 76da00c619..5d64f57b3e 100644
--- a/zebra/kernel_netlink.c
+++ b/zebra/kernel_netlink.c
@@ -712,7 +712,11 @@ static ssize_t netlink_send_msg(const struct nlsock *nl, void *buf,
if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) {
zlog_debug("%s: >> netlink message dump [sent]", __func__);
+#ifdef NETLINK_DEBUG
+ nl_dump(buf, buflen);
+#else
zlog_hexdump(buf, buflen);
+#endif /* NETLINK_DEBUG */
}
if (status == -1) {
@@ -770,7 +774,11 @@ static int netlink_recv_msg(const struct nlsock *nl, struct msghdr msg,
if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) {
zlog_debug("%s: << netlink message dump [recv]", __func__);
+#ifdef NETLINK_DEBUG
+ nl_dump(buf, status);
+#else
zlog_hexdump(buf, status);
+#endif /* NETLINK_DEBUG */
}
return status;