summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Eitzenberger <heitzenberger@astaro.com>2009-10-21 15:47:35 +0200
committerHarald Welte <laforge@gnumonks.org>2010-10-21 19:15:39 +0200
commit850a1ec8379d25a7fb9c979964d646afb7d589ab (patch)
tree7087afe15285986337d202f7ddbcae9dfef3e313
parent691bb69a25ba7a6e053fd7d63491f6241df786dd (diff)
Add 'configure' check for Astaro logmark
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
-rw-r--r--config.h.in3
-rw-r--r--configure.in15
-rw-r--r--input/packet/ulogd_inppkt_NFLOG.c4
3 files changed, 22 insertions, 0 deletions
diff --git a/config.h.in b/config.h.in
index 1291f4f..52946d7 100644
--- a/config.h.in
+++ b/config.h.in
@@ -22,6 +22,9 @@
/* Define to 1 if you have the `mysqlclient' library (-lmysqlclient). */
#undef HAVE_LIBMYSQLCLIENT
+/* Define to 1 if you have libnl with logmark support. */
+#undef HAVE_LIBNL_LOGMARK
+
/* Define to 1 if you have the `pcap' library (-lpcap). */
#undef HAVE_LIBPCAP
diff --git a/configure.in b/configure.in
index f9abe8a..79bc49e 100644
--- a/configure.in
+++ b/configure.in
@@ -36,6 +36,21 @@ AC_CHECK_HEADER([netlink/netfilter/log.h],,
AC_CHECK_HEADER([netlink/netfilter/ct.h],,
[AC_MSG_ERROR([libnl with ctnetlink support needed])])
+AC_MSG_CHECKING(whether libnl has logmark support)
+SAVED_LIBS="$LIBS"
+LIBS="-lnl"
+AC_LINK_IFELSE([AC_LANG_SOURCE([[
+#include <netlink/utils.h>
+#include <netlink/msg.h>
+#include <netlink/netfilter/nfnl.h>
+#include <netlink/netfilter/log.h>
+main() {
+ nfnl_log_test_logmark((void *)0);
+ return 0;
+}
+]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LIBNL_LOGMARK, 1, [Define to 1 if you have libnl with logmark support.])],[AC_MSG_RESULT(no)],)
+LIBS="$SAVED_LIBS"
CT_CHECK_POSTGRES_DB()
AM_CONDITIONAL(HAVE_PGSQL, test "x$PQLIBPATH" != "x")
diff --git a/input/packet/ulogd_inppkt_NFLOG.c b/input/packet/ulogd_inppkt_NFLOG.c
index 99bbc24..35bbbb2 100644
--- a/input/packet/ulogd_inppkt_NFLOG.c
+++ b/input/packet/ulogd_inppkt_NFLOG.c
@@ -141,9 +141,11 @@ nflog_dump(const char *prefix, const struct nl_object *obj)
if (nfnl_log_test_mark(nflog_obj))
pch += snprintf(pch, AVAIL, "mark=%u ", nfnl_log_get_mark(nflog_obj));
+#ifdef HAVE_LIBNL_LOGMARK
if (nfnl_log_test_logmark(nflog_obj))
pch += snprintf(pch, AVAIL, "logmark=%u ",
nfnl_log_get_logmark(nflog_obj));
+#endif /* HAVE_LIBNL_LOGMARK */
if (nfnl_log_get_payload(nflog_obj, &len))
pch += snprintf(pch, AVAIL, "payloadlen=%d ", len);
@@ -205,8 +207,10 @@ nflog_handle_msg(struct nl_object *obj, void *arg)
if (nfnl_log_test_seq_global(nflog_obj))
key_set_u32(&out[K_OOB_SEQ_GLOBAL], nfnl_log_get_seq_global(nflog_obj));
+#ifdef HAVE_LIBNL_LOGMARK
if (nfnl_log_test_logmark(nflog_obj))
key_set_u32(&out[K_OOB_LOGMARK], nfnl_log_get_logmark(nflog_obj));
+#endif /* HAVE_LIBNL_LOGMARK */
ulogd_propagate_results(upi, &flags);
}