[ULOGD PATCH 5/8] Add a list of used plugininstance.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds plist a linked list to the pluginstance
structure. It can be used by input modules to duplicate an
entry. This solves the issue of not being able to use the same
plugin instance twice.

Signed-off-by: Eric Leblond <eric@xxxxxx>
---
 include/ulogd/ulogd.h |    2 ++
 src/ulogd.c           |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/ulogd/ulogd.h b/include/ulogd/ulogd.h
index 39ac464..73a1711 100644
--- a/include/ulogd/ulogd.h
+++ b/include/ulogd/ulogd.h
@@ -168,6 +168,8 @@ struct ulogd_plugin {
 struct ulogd_pluginstance {
 	/* local list of plugins in this stack */
 	struct llist_head list;
+	/* local list of plugininstance in other stacks */
+	struct llist_head plist;
 	/* plugin */
 	struct ulogd_plugin *plugin;
 	/* stack that we're part of */
diff --git a/src/ulogd.c b/src/ulogd.c
index b69d25d..a6356f2 100644
--- a/src/ulogd.c
+++ b/src/ulogd.c
@@ -529,6 +529,7 @@ pluginstance_alloc_init(struct ulogd_plugin *pl, char *pi_id,
 	/* initialize */
 	memset(pi, 0, size);
 	INIT_LLIST_HEAD(&pi->list);
+	INIT_LLIST_HEAD(&pi->plist);
 	pi->plugin = pl;
 	pi->stack = stack;
 	memcpy(pi->id, pi_id, sizeof(pi->id));
@@ -722,6 +723,7 @@ static int pluginstance_started(struct ulogd_pluginstance *npi)
 			/* OK, pluginstance already exists in stack 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.4.3

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux