From 9f53603a10aa738d6f5a41a061bc3e1182c42d0c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 17 Feb 2011 18:33:22 +0100 Subject: conntrack: add NFCT_CP_OVERRIDE flag for nfct_copy() Thus, we have a fast version of nfct_copy() which allows to copy the destination to the origin. After this call, the destination is a clone of the origin. Signed-off-by: Pablo Neira Ayuso --- src/conntrack/copy.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/conntrack/copy.c') diff --git a/src/conntrack/copy.c b/src/conntrack/copy.c index 94d0711..c3a4fcc 100644 --- a/src/conntrack/copy.c +++ b/src/conntrack/copy.c @@ -505,3 +505,11 @@ const copy_attr copy_attr_array[ATTR_MAX] = { [ATTR_TIMESTAMP_START] = copy_attr_timestamp_start, [ATTR_TIMESTAMP_STOP] = copy_attr_timestamp_stop, }; + +/* this is used by nfct_copy() with the NFCT_CP_OVERRIDE flag set. */ +void __copy_fast(struct nf_conntrack *ct1, const struct nf_conntrack *ct2) +{ + memcpy(ct1, ct2, sizeof(*ct1)); + /* special case: secctx attribute is allocated dinamically. */ + copy_attr_secctx(ct1, ct2); +} -- cgit v1.2.3