diff options
author | Arturo Borrero Gonzalez <arturo@netfilter.org> | 2017-07-12 13:29:49 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-07-17 17:20:34 +0200 |
commit | 8069b60a331141f00924f9fc9fad478badff6687 (patch) | |
tree | 7332aa9614911375e8c8ad84ddbddae845586a52 /src/mnl.c | |
parent | 30821c4d81ee3bd430030f69e9a838b8b4e8244d (diff) |
monitor: add debug messages
Add some debug messages in the monitor/trace code paths to ease development
and debugging in case of errors.
After this patch, running 'nft monitor --debug=mnl,netlink' is more verbose.
Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/mnl.c')
-rw-r--r-- | src/mnl.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1139,6 +1139,13 @@ int mnl_nft_event_listener(struct mnl_socket *nf_sock, fprintf(stdout, "# ERROR: %s\n", strerror(errno)); break; } + +#ifdef DEBUG + if (debug_level & DEBUG_MNL) { + mnl_nlmsg_fprintf(stdout, buf, sizeof(buf), + sizeof(struct nfgenmsg)); + } +#endif /* DEBUG */ ret = mnl_cb_run(buf, ret, 0, 0, cb, cb_data); if (ret <= 0) break; |