summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2010-06-17 16:38:23 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2010-06-17 16:38:23 +0200
commitaaf58394294ffe3460334cf8ee76bd10d0f10e4a (patch)
tree4580dee6585f6baf6d23b8a339617c7469e4addc /input
parent5f039c7d87739defae72da96020ea84a8311eb9c (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'input')
-rw-r--r--input/flow/ulogd_inpflow_NFCT.c9
1 files changed, 8 insertions, 1 deletions
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