From aaf58394294ffe3460334cf8ee76bd10d0f10e4a Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 17 Jun 2010 16:38:23 +0200 Subject: NFCT: copy the conntrack object to the plugin once With this patch, we copy the conntrack object that we propagate to the output plugin instances *only once*. Signed-off-by: Pablo Neira Ayuso --- input/flow/ulogd_inpflow_NFCT.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'input') diff --git a/input/flow/ulogd_inpflow_NFCT.c b/input/flow/ulogd_inpflow_NFCT.c index 4376a06..8097fd1 100644 --- a/input/flow/ulogd_inpflow_NFCT.c +++ b/input/flow/ulogd_inpflow_NFCT.c @@ -556,7 +556,6 @@ static int propagate_ct(struct ulogd_pluginstance *main_upi, ts->time[STOP].tv_usec); } } - memcpy(cpi->ct, ct, nfct_sizeof(ct)); okey_set_ptr(&ret[NFCT_CT], cpi->ct); ulogd_propagate_results(upi); @@ -571,6 +570,14 @@ do_propagate_ct(struct ulogd_pluginstance *upi, struct ct_timestamp *ts) { struct ulogd_pluginstance *npi = NULL; + struct nfct_pluginstance *cpi = + (struct nfct_pluginstance *) upi->private; + + /* we copy the conntrack object to the plugin cache. + * Thus, we only copy the object once, then it is used + * by the several output plugin instance that reference + * it by means of a pointer. */ + memcpy(cpi->ct, ct, nfct_sizeof(ct)); /* since we support the re-use of one instance in * several different stacks, we duplicate the message -- cgit v1.2.3