All of lore.kernel.org
 help / color / mirror / Atom feed
* [ULOGD PATCH] Fix multiple usage of DB output plugin.
@ 2008-04-20 22:45 Eric Leblond
  2008-04-21 12:11 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Leblond @ 2008-04-20 22:45 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Eric Leblond

Hello,

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.

BR,

Signed-off-by: Eric Leblond <eric@inl.fr>
---
 src/ulogd.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/ulogd.c b/src/ulogd.c
index 249bde3..3a1e3d9 100644
--- a/src/ulogd.c
+++ b/src/ulogd.c
@@ -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;
+				}
 			}
 		}
 	}
-- 
1.5.2.5

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

* Re: [ULOGD PATCH] Fix multiple usage of DB output plugin.
  2008-04-20 22:45 [ULOGD PATCH] Fix multiple usage of DB output plugin Eric Leblond
@ 2008-04-21 12:11 ` Patrick McHardy
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2008-04-21 12:11 UTC (permalink / raw)
  To: Eric Leblond; +Cc: netfilter-devel

Eric Leblond wrote:
> Hello,
> 
> 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.


This seem to fix a crash I was getting with the latest SVN version.
Applied, thanks.

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

end of thread, other threads:[~2008-04-21 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-20 22:45 [ULOGD PATCH] Fix multiple usage of DB output plugin Eric Leblond
2008-04-21 12:11 ` 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.