[netfilter-cvslog] r7352 - in branches/ulog/ulogd2: filter include/ulogd util

pablo at netfilter.org pablo at netfilter.org
Sat Feb 9 18:34:00 CET 2008


Author: pablo at netfilter.org
Date: 2008-02-09 18:34:00 +0100 (Sat, 09 Feb 2008)
New Revision: 7352

Modified:
   branches/ulog/ulogd2/filter/ulogd_filter_IP2BIN.c
   branches/ulog/ulogd2/filter/ulogd_filter_IP2STR.c
   branches/ulog/ulogd2/include/ulogd/ulogd.h
   branches/ulog/ulogd2/util/printflow.c
   branches/ulog/ulogd2/util/printpkt.c
Log:
From: Eric Leblond <eric at inl.fr>
Some macros were defined several time. This was the case of GET_VALUE,
pp_is_valid. This patch puts the definition in ulogd.h and fixes the
definition of pp_is_valid which was wrong (causing segfault by acessing to
fields at NULL).


Modified: branches/ulog/ulogd2/filter/ulogd_filter_IP2BIN.c
===================================================================
--- branches/ulog/ulogd2/filter/ulogd_filter_IP2BIN.c	2008-02-09 17:30:38 UTC (rev 7351)
+++ branches/ulog/ulogd2/filter/ulogd_filter_IP2BIN.c	2008-02-09 17:34:00 UTC (rev 7352)
@@ -114,11 +114,6 @@
 
 };
 
-#define GET_VALUE(res, x)	(res[x].u.source->u.value)
-#define GET_FLAGS(res, x)	(res[x].u.source->flags)
-#define pp_is_valid(res, x)	\
-	(res[x].u.source && (GET_FLAGS(res, x) & ULOGD_RETF_VALID))
-
 /**
  * Convert IPv4 address (as 32-bit unsigned integer) to IPv6 address:
  * add 96 bits prefix "::ffff:" to get IPv6 address "::ffff:a.b.c.d".

Modified: branches/ulog/ulogd2/filter/ulogd_filter_IP2STR.c
===================================================================
--- branches/ulog/ulogd2/filter/ulogd_filter_IP2STR.c	2008-02-09 17:30:38 UTC (rev 7351)
+++ branches/ulog/ulogd2/filter/ulogd_filter_IP2STR.c	2008-02-09 17:34:00 UTC (rev 7352)
@@ -113,11 +113,6 @@
 	},
 };
 
-#define GET_VALUE(res, x)	(res[x].u.source->u.value)
-#define GET_FLAGS(res, x)	(res[x].u.source->flags)
-#define pp_is_valid(res, x)	\
-	(res[x].u.source && (GET_FLAGS(res, x) & ULOGD_RETF_VALID))
-
 static char *ip2str(struct ulogd_key* inp, int index, char family)
 {
 	char tmp[IPADDR_LENGTH];

Modified: branches/ulog/ulogd2/include/ulogd/ulogd.h
===================================================================
--- branches/ulog/ulogd2/include/ulogd/ulogd.h	2008-02-09 17:30:38 UTC (rev 7351)
+++ branches/ulog/ulogd2/include/ulogd/ulogd.h	2008-02-09 17:34:00 UTC (rev 7352)
@@ -216,6 +216,11 @@
 #define IS_NEEDED(x)	(x.flags & ULOGD_RETF_NEEDED)
 #define SET_NEEDED(x)	(x.flags |= ULOGD_RETF_NEEDED)
 
+#define GET_VALUE(res, x)	(res[x].u.source->u.value)
+#define GET_FLAGS(res, x)	(res[x].u.source->flags)
+#define pp_is_valid(res, x)	\
+	(res[x].u.source && (GET_FLAGS(res, x) & ULOGD_RETF_VALID))
+
 int ulogd_key_size(struct ulogd_key *key);
 int ulogd_wildcard_inputkeys(struct ulogd_pluginstance *upi);
 

Modified: branches/ulog/ulogd2/util/printflow.c
===================================================================
--- branches/ulog/ulogd2/util/printflow.c	2008-02-09 17:30:38 UTC (rev 7351)
+++ branches/ulog/ulogd2/util/printflow.c	2008-02-09 17:34:00 UTC (rev 7352)
@@ -131,10 +131,6 @@
 };
 int printflow_keys_num = sizeof(printflow_keys)/sizeof(*printflow_keys);
 
-#define GET_VALUE(res, x)	(res[x].u.source->u.value)
-#define GET_FLAGS(res, x)	(res[x].u.source->flags)
-#define pp_is_valid(res, x)	(GET_FLAGS(res, x) & ULOGD_RETF_VALID)
-
 #define pp_print(buf_cur, label, res, x, type) \
 	if (pp_is_valid(res, x)) \
 		buf_cur += sprintf(buf_cur, label"=%u ", GET_VALUE(res, x).type);

Modified: branches/ulog/ulogd2/util/printpkt.c
===================================================================
--- branches/ulog/ulogd2/util/printpkt.c	2008-02-09 17:30:38 UTC (rev 7351)
+++ branches/ulog/ulogd2/util/printpkt.c	2008-02-09 17:34:00 UTC (rev 7352)
@@ -89,10 +89,6 @@
 	[KEY_AHESP_SPI]		= { .name = "ahesp.spi", },
 };
 
-#define GET_VALUE(res, x)	(res[x].u.source->u.value)
-#define GET_FLAGS(res, x)	(res[x].u.source->flags)
-#define pp_is_valid(res, x)	(GET_FLAGS(res, x) & ULOGD_RETF_VALID)
-
 static int printpkt_proto(struct ulogd_key *res, char *buf, int protocol)
 {
 	char *buf_cur = buf;




More information about the netfilter-cvslog mailing list