diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-08-22 18:19:12 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-08-23 23:42:33 +0200 |
commit | a6ba3ad626ccd15f9104b3143c297f39cce6e050 (patch) | |
tree | 4cfe6caba40c1d639e3a61ba78cfdf44505513f0 /src/mnl.c | |
parent | 4dedecf4d64ef64f7f86efeeed117be931005282 (diff) |
src: remove ifdef DEBUG pollution
Get rid of lots of ifdef DEBUG pollution in the code.
The --debug= option is useful to get feedback from users, so it should
be always there. And we really save nothing from keeping this code away
from the control plane with a compile time option. Just running
tests/shell/ before and after this patch, time shows almost no
difference.
So this patch leaves --enable-debug around to add debugging symbols in
your builds, this is left set on by default.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/mnl.c')
-rw-r--r-- | src/mnl.c | 8 |
1 files changed, 0 insertions, 8 deletions
@@ -72,10 +72,8 @@ nft_mnl_talk(struct mnl_socket *nf_sock, const void *data, { uint32_t portid = mnl_socket_get_portid(nf_sock); -#ifdef DEBUG if (debug_level & DEBUG_MNL) mnl_nlmsg_fprintf(stdout, data, len, sizeof(struct nfgenmsg)); -#endif if (mnl_socket_sendto(nf_sock, data, len) < 0) return -1; @@ -223,14 +221,11 @@ static ssize_t mnl_nft_socket_sendmsg(const struct mnl_socket *nl, .msg_iov = iov, .msg_iovlen = iov_len, }; -#ifdef DEBUG uint32_t i; -#endif mnl_set_sndbuffer(nl, batch); nftnl_batch_iovec(batch, iov, iov_len); -#ifdef DEBUG for (i = 0; i < iov_len; i++) { if (debug_level & DEBUG_MNL) { mnl_nlmsg_fprintf(stdout, @@ -238,7 +233,6 @@ static ssize_t mnl_nft_socket_sendmsg(const struct mnl_socket *nl, sizeof(struct nfgenmsg)); } } -#endif return sendmsg(mnl_socket_get_fd(nl), &msg, 0); } @@ -1072,12 +1066,10 @@ int mnl_nft_event_listener(struct mnl_socket *nf_sock, } } -#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; |