diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-09-23 11:11:08 -0300 |
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-09-23 23:07:02 -0300 |
| commit | eead0bc46b9ba49f49a4c2939c89e74b3266b452 (patch) | |
| tree | ddc08aa87c3d9d312fe7f6be3c76432943caaf16 /zebra/kernel_netlink.c | |
| parent | 0ce5baaab1cefb0cd89cd526ab5225cd3a58a921 (diff) | |
zebra: human readable netlink dumps
Add new compile option to enable human readable netlink dumps with
`debug zebra kernel msgdump`.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'zebra/kernel_netlink.c')
| -rw-r--r-- | zebra/kernel_netlink.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index ad0d4bf56b..e121228ac8 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; |
