summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/libipset/debug.h2
-rw-r--r--lib/session.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/include/libipset/debug.h b/include/libipset/debug.h
index 9743d59..92d5f89 100644
--- a/include/libipset/debug.h
+++ b/include/libipset/debug.h
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <sys/socket.h>
#include <linux/netlink.h>
+#define DD(cmd) cmd
#define D(fmt, args...) \
fprintf(stderr, "%s: %s: " fmt "\n", __FILE__, __func__ , ## args)
#define IF_D(test, fmt, args...) \
@@ -25,6 +26,7 @@ dump_nla(struct nlattr *nla[], int maxlen)
D("nla[%u] does%s exist", i, nla[i] ? "" : " NOT");
}
#else
+#define DD(cmd)
#define D(fmt, args...)
#define IF_D(test, fmt, args...)
#define dump_nla(nla, maxlen)
diff --git a/lib/session.c b/lib/session.c
index b088bc8..1ca26ff 100644
--- a/lib/session.c
+++ b/lib/session.c
@@ -1982,7 +1982,7 @@ build_msg(struct ipset_session *session, bool aggregate)
break;
case IPSET_CMD_ADD:
case IPSET_CMD_DEL: {
- const struct ipset_type *type;
+ DD(const struct ipset_type *type);
if (!aggregate) {
/* Setname, type not checked/added yet */
@@ -2007,7 +2007,7 @@ build_msg(struct ipset_session *session, bool aggregate)
open_nested(session, nlh, IPSET_ATTR_ADT);
}
}
- type = ipset_data_get(data, IPSET_OPT_TYPE);
+ DD(type = ipset_data_get(data, IPSET_OPT_TYPE));
D("family: %u, type family %u",
ipset_data_family(data), type->family);
if (open_nested(session, nlh, IPSET_ATTR_DATA)) {
@@ -2027,7 +2027,7 @@ build_msg(struct ipset_session *session, bool aggregate)
break;
}
case IPSET_CMD_TEST: {
- const struct ipset_type *type;
+ DD(const struct ipset_type *type);
/* Return codes are not aggregated, so tests cannot be either */
/* Setname, type not checked/added yet */
@@ -2040,7 +2040,7 @@ build_msg(struct ipset_session *session, bool aggregate)
return ipset_err(session,
"Invalid test command: missing settype");
- type = ipset_data_get(data, IPSET_OPT_TYPE);
+ DD(type = ipset_data_get(data, IPSET_OPT_TYPE));
D("family: %u, type family %u",
ipset_data_family(data), type->family);
ADDATTR_SETNAME(session, nlh, data);