diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-06-17 15:20:57 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-06-17 15:20:57 +0200 |
commit | 712896b182c1e62d5e49f5a6859832708d3dd0fe (patch) | |
tree | 987aa06cf02256768e051d01962efaf429d3a6e3 /input/flow/ulogd_inpflow_NFCT.c | |
parent | 9148f585020f5304b61241ed588630969d6f8c04 (diff) |
NFCT: fix plugin re-use in different stacks
This patch fixes a problem in configurations that use the NFCT
plugin as input in several stacks. The first plugin loaded contains
the hashtable and other important NFCT private data. Other plugin
instances of NFCT are dummies that are only used to store the
output keys.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'input/flow/ulogd_inpflow_NFCT.c')
-rw-r--r-- | input/flow/ulogd_inpflow_NFCT.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/input/flow/ulogd_inpflow_NFCT.c b/input/flow/ulogd_inpflow_NFCT.c index 3978f2f..4376a06 100644 --- a/input/flow/ulogd_inpflow_NFCT.c +++ b/input/flow/ulogd_inpflow_NFCT.c @@ -454,14 +454,16 @@ static int compare(const void *data1, const void *data2) return nfct_cmp(u1->ct, ct, NFCT_CMP_ORIG | NFCT_CMP_REPL); } -static int propagate_ct(struct ulogd_pluginstance *upi, +/* only the main_upi plugin instance contains the correct private data. */ +static int propagate_ct(struct ulogd_pluginstance *main_upi, + struct ulogd_pluginstance *upi, struct nf_conntrack *ct, int type, struct ct_timestamp *ts) { struct ulogd_key *ret = upi->output.keys; struct nfct_pluginstance *cpi = - (struct nfct_pluginstance *) upi->private; + (struct nfct_pluginstance *) main_upi->private; okey_set_u32(&ret[NFCT_CT_EVENT], type); okey_set_u8(&ret[NFCT_OOB_FAMILY], nfct_get_attr_u8(ct, ATTR_L3PROTO)); @@ -574,11 +576,11 @@ do_propagate_ct(struct ulogd_pluginstance *upi, * several different stacks, we duplicate the message * to let them know */ llist_for_each_entry(npi, &upi->plist, plist) { - if (propagate_ct(npi, ct, type, ts) != 0) + if (propagate_ct(upi, npi, ct, type, ts) != 0) break; } - propagate_ct(upi, ct, type, ts); + propagate_ct(upi, upi, ct, type, ts); } static int |