path: root/extensions
diff options
authorPhil Sutter <>2018-08-02 17:05:15 +0200
committerFlorian Westphal <>2018-08-04 14:24:54 +0200
commit78b9d438037f2c83a7bbb73eb1b86cc295967905 (patch)
treeda1268751fdf521e545fefdbd126717c84f6ce52 /extensions
parent14ad525cf2ad35928c12e7ec6710fb556f6d1ef7 (diff)
Consolidate DEBUGP macros
This debug printing macro was defined in various places, always identical. Move it into xshared.h and drop it from sources including that header. There are a few exceptions: * iptables-xml.c did not include xshared.h, which this patch changes. * Sources in extensions and libiptc mostly left alone since they don't include xshared.h (and maybe shouldn't). Only libxt_set.h does, so it's converted, too. This also converts DEBUG define use in libip6t_hbh.c to avoid a compiler warning. Signed-off-by: Phil Sutter <> Signed-off-by: Florian Westphal <>
Diffstat (limited to 'extensions')
2 files changed, 2 insertions, 10 deletions
diff --git a/extensions/libip6t_hbh.c b/extensions/libip6t_hbh.c
index 76b4ff00..4cebecfd 100644
--- a/extensions/libip6t_hbh.c
+++ b/extensions/libip6t_hbh.c
@@ -5,8 +5,6 @@
#include <xtables.h>
#include <linux/netfilter_ipv6/ip6t_opts.h>
-#define DEBUG 0
enum {
O_HBH_LEN = 0,
@@ -83,7 +81,7 @@ parse_options(const char *optsstr, uint16_t *opts)
opts[i] |= (0x00FF);
-#if DEBUG
+#ifdef DEBUG
printf("opts str: %s %s\n", cp, range);
printf("opts opt: %04X\n", opts[i]);
@@ -92,7 +90,7 @@ parse_options(const char *optsstr, uint16_t *opts)
-#if DEBUG
+#ifdef DEBUG
printf("addr nr: %d\n", i);
diff --git a/extensions/libxt_set.h b/extensions/libxt_set.h
index 5a1bdcf7..41dfbd30 100644
--- a/extensions/libxt_set.h
+++ b/extensions/libxt_set.h
@@ -8,12 +8,6 @@
#include <errno.h>
#include "../iptables/xshared.h"
-#ifdef DEBUG
-#define DEBUGP(x, args...) fprintf(stderr, x , ## args)
-#define DEBUGP(x, args...)
static int
get_version(unsigned *version)