summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2017-08-22 18:19:12 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-08-23 23:42:33 +0200
commita6ba3ad626ccd15f9104b3143c297f39cce6e050 (patch)
tree4cfe6caba40c1d639e3a61ba78cfdf44505513f0 /src/main.c
parent4dedecf4d64ef64f7f86efeeed117be931005282 (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/main.c')
-rw-r--r--src/main.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index fc44b186..4c74bdce 100644
--- a/src/main.c
+++ b/src/main.c
@@ -29,9 +29,7 @@
#include <cli.h>
static struct nft_ctx nft;
-#ifdef DEBUG
unsigned int debug_level;
-#endif
enum opt_vals {
OPT_HELP = 'h',
@@ -90,13 +88,11 @@ static const struct option options[] = {
.val = OPT_INCLUDEPATH,
.has_arg = 1,
},
-#ifdef DEBUG
{
.name = "debug",
.val = OPT_DEBUG,
.has_arg = 1,
},
-#endif
{
.name = "handle",
.val = OPT_HANDLE_OUTPUT,
@@ -131,14 +127,11 @@ static void show_help(const char *name)
" -a, --handle Output rule handle.\n"
" -e, --echo Echo what has been added, inserted or replaced.\n"
" -I, --includepath <directory> Add <directory> to the paths searched for include files. Default is: %s\n"
-#ifdef DEBUG
" --debug <level [,level...]> Specify debugging level (scanner, parser, eval, netlink, mnl, proto-ctx, segtree, all)\n"
-#endif
"\n",
name, DEFAULT_INCLUDE_PATH);
}
-#ifdef DEBUG
static const struct {
const char *name;
enum debug_level level;
@@ -176,7 +169,6 @@ static const struct {
.level = ~0,
},
};
-#endif
static const struct input_descriptor indesc_cmdline = {
.type = INDESC_BUFFER,
@@ -359,7 +351,6 @@ int main(int argc, char * const *argv)
case OPT_IP2NAME:
nft.output.ip2name++;
break;
-#ifdef DEBUG
case OPT_DEBUG:
for (;;) {
unsigned int i;
@@ -387,7 +378,6 @@ int main(int argc, char * const *argv)
optarg = end + 1;
}
break;
-#endif
case OPT_HANDLE_OUTPUT:
nft.output.handle++;
break;