[netfilter-cvslog] r7500 - branches/ulog/ulogd2/src

kaber at trash.net kaber at trash.net
Mon Apr 21 14:21:23 CEST 2008


Author: kaber at trash.net
Date: 2008-04-21 14:21:23 +0200 (Mon, 21 Apr 2008)
New Revision: 7500

Modified:
   branches/ulog/ulogd2/src/ulogd.c
Log:
[ULOGD PATCH] Fix multiple usage of DB output plugin.

Due to the modifications done to be able to use multiple time the SOURCE
plugin, a single instance of database output plugin could not anymore be
used in separate stack. This patch fixes this by limiting the effect of
the previous modification on SOURCE plugin.

Signed-off-by: Eric Leblond <eric at inl.fr>


Modified: branches/ulog/ulogd2/src/ulogd.c
===================================================================
--- branches/ulog/ulogd2/src/ulogd.c	2008-04-16 15:37:39 UTC (rev 7499)
+++ branches/ulog/ulogd2/src/ulogd.c	2008-04-21 12:21:23 UTC (rev 7500)
@@ -717,13 +717,17 @@
 	struct ulogd_pluginstance_stack *stack;
 	struct ulogd_pluginstance *pi;
 
-	llist_for_each_entry(stack, &ulogd_pi_stacks, stack_list) {
-		llist_for_each_entry(pi, &stack->list, list) {
-			if (!strcmp(pi->id, npi->id)) {
-				ulogd_log(ULOGD_INFO, "%s instance already "
-						      "loaded\n", pi->id);
-				llist_add(&pi->plist, &npi->plist);
-				return 1;
+	/* Only SOURCE plugin need to be started once */
+	if (npi->plugin->input.type == ULOGD_DTYPE_SOURCE) {
+		llist_for_each_entry(stack, &ulogd_pi_stacks, stack_list) {
+			llist_for_each_entry(pi, &stack->list, list) {
+				if (!strcmp(pi->id, npi->id)) {
+					ulogd_log(ULOGD_INFO,
+							"%s instance already "
+							"loaded\n", pi->id);
+					llist_add(&pi->plist, &npi->plist);
+					return 1;
+				}
 			}
 		}
 	}




More information about the netfilter-cvslog mailing list