From: Tomasz Bursztyka Date: Tue, 11 Feb 2014 16:36:42 +0000 (+0200) Subject: nft: Add useful debug output when a builtin table is created X-Git-Tag: v1.6.0~111^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=837629fed24af7298fbf4cd28c7a51f24b70ee93;p=thirdparty%2Fiptables.git nft: Add useful debug output when a builtin table is created This is useful to know if a builtin table is requested to be created. Signed-off-by: Tomasz Bursztyka Signed-off-by: Pablo Neira Ayuso --- diff --git a/iptables/nft.c b/iptables/nft.c index a45d599b..36ac69cc 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -451,6 +451,14 @@ nft_table_builtin_add(struct nft_handle *h, struct builtin_table *_t, nft_table_nlmsg_build_payload(nlh, t); nft_table_free(t); +#ifdef NLDEBUG + char tmp[1024]; + + nft_table_snprintf(tmp, sizeof(tmp), t, 0, 0); + printf("DEBUG: table: %s", tmp); + mnl_nlmsg_fprintf(stdout, nlh, nlh->nlmsg_len, sizeof(struct nfgenmsg)); +#endif + ret = mnl_talk(h, nlh, NULL, NULL); if (ret < 0) { if (errno != EEXIST)