netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2 nft] mnl: print netlink message if if --debug=netlink in mnl_talk()
@ 2013-12-28  0:01 Pablo Neira Ayuso
  2013-12-28  0:01 ` [PATCH 2/2 nft] netlink: fix dictionary feature Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira Ayuso @ 2013-12-28  0:01 UTC (permalink / raw)
  To: netfilter-devel

Useful for debugging purposes.
---
 src/mnl.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mnl.c b/src/mnl.c
index fe218fc..a711b5e 100644
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -38,6 +38,11 @@ mnl_talk(struct mnl_socket *nf_sock, const void *data, unsigned int len,
 	uint32_t portid = mnl_socket_get_portid(nf_sock);
 	int ret;
 
+#ifdef DEBUG
+	if (debug_level & DEBUG_NETLINK)
+		mnl_nlmsg_fprintf(stdout, data, len, sizeof(struct nfgenmsg));
+#endif
+
 	if (mnl_socket_sendto(nf_sock, data, len) < 0)
 		return -1;
 
-- 
1.7.10.4


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

end of thread, other threads:[~2013-12-28  0:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28  0:01 [PATCH 1/2 nft] mnl: print netlink message if if --debug=netlink in mnl_talk() Pablo Neira Ayuso
2013-12-28  0:01 ` [PATCH 2/2 nft] netlink: fix dictionary feature Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).