All of lore.kernel.org
 help / color / mirror / Atom feed
* [ULOGD PATCH, RFC] Modify NFLOG to be able to use it with older libnetfilter_log
@ 2008-04-21 21:52 Eric Leblond
  2008-04-22  4:59 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Leblond @ 2008-04-21 21:52 UTC (permalink / raw)
  To: kaber, netfilter-devel; +Cc: Eric Leblond

Hello,

NFLOG has been modified to support GID display. There is a problem as this
feature is only available in latest subversion of libnetfilter_log. This
patch made this feature optional:
 * It detects if system support the nflog_get_gid() function
 * Compilation of nflog_get_gid() related code is conditional

BR,
---
 configure.in                      |    4 ++++
 input/packet/ulogd_inppkt_NFLOG.c |    3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index a70848c..7a6d705 100644
--- a/configure.in
+++ b/configure.in
@@ -41,6 +41,10 @@ AC_CHECK_HEADER([libnetfilter_log/linux_nfnetlink_log.h], [AC_MSG_RESULT([found]
 AC_CHECK_HEADER([libnetfilter_conntrack/libnetfilter_conntrack.h], [AC_MSG_RESULT([found])],
 		[AC_MSG_ERROR([libnetfilter_conntrack Version 0.0.11 or later needed])])
 
+AC_CHECK_LIB([netfilter_log], [nflog_get_gid],
+	     AC_DEFINE_UNQUOTED([HAVE_NFLOG_GET_GID],[1],[libnetfilter_log has GID support]),,
+	     [-lnfnetlink])
+
 
 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 13f59a7..a510cba 100644
--- a/input/packet/ulogd_inppkt_NFLOG.c
+++ b/input/packet/ulogd_inppkt_NFLOG.c
@@ -353,11 +353,12 @@ interp_packet(struct ulogd_pluginstance *upi, struct nflog_data *ldata)
 		ret[NFLOG_KEY_OOB_UID].u.value.ui32 = uid;
 		ret[NFLOG_KEY_OOB_UID].flags |= ULOGD_RETF_VALID;
 	}
+#ifdef HAVE_NFLOG_GET_GID
 	if (nflog_get_gid(ldata, &gid) == 0) {
 		ret[NFLOG_KEY_OOB_GID].u.value.ui32 = gid;
 		ret[NFLOG_KEY_OOB_GID].flags |= ULOGD_RETF_VALID;
 	}
-
+#endif
 	if (nflog_get_seq(ldata, &seq) == 0) {
 		ret[NFLOG_KEY_OOB_SEQ_LOCAL].u.value.ui32 = seq;
 		ret[NFLOG_KEY_OOB_SEQ_LOCAL].flags |= ULOGD_RETF_VALID;
-- 
1.5.2.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [ULOGD PATCH, RFC] Modify NFLOG to be able to use it with older libnetfilter_log
  2008-04-21 21:52 [ULOGD PATCH, RFC] Modify NFLOG to be able to use it with older libnetfilter_log Eric Leblond
@ 2008-04-22  4:59 ` Patrick McHardy
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2008-04-22  4:59 UTC (permalink / raw)
  To: Eric Leblond; +Cc: netfilter-devel

Eric Leblond wrote:
> Hello,
> 
> NFLOG has been modified to support GID display. There is a problem as this
> feature is only available in latest subversion of libnetfilter_log. This
> patch made this feature optional:
>  * It detects if system support the nflog_get_gid() function
>  * Compilation of nflog_get_gid() related code is conditional

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-22  4:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-21 21:52 [ULOGD PATCH, RFC] Modify NFLOG to be able to use it with older libnetfilter_log Eric Leblond
2008-04-22  4:59 ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.