]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
[ULOGD PATCH] Fix multiple usage of DB output plugin.
author/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net>
Mon, 21 Apr 2008 12:21:23 +0000 (12:21 +0000)
committer/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net>
Mon, 21 Apr 2008 12:21:23 +0000 (12:21 +0000)
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@inl.fr>
src/ulogd.c

index 249bde3f05b04775b53919708fec32b7ac30a85c..3a1e3d992c535a9cf98f177b20b9eb88bffa7faf 100644 (file)
@@ -717,13 +717,17 @@ static int pluginstance_started(struct ulogd_pluginstance *npi)
        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;
+                               }
                        }
                }
        }