diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-11-16 02:10:31 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-01-10 01:54:45 +0100 |
commit | 75a7cd3c722e1abca14fc375bec8ab30c34ab284 (patch) | |
tree | 34b33b726bbba606ec77b98340331e026ce781a3 /src/sync-notrack.c | |
parent | 79ab299bfb20b7fc1982ca90d77d8b908b824fea (diff) | |
download | conntrack-tools-75a7cd3c722e1abca14fc375bec8ab30c34ab284.tar.gz conntrack-tools-75a7cd3c722e1abca14fc375bec8ab30c34ab284.zip |
conntrackd: remove cache_data_get_object and replace by direct pointer
We now include one pointer to the object in the extra section.
This is required to generalize this code for the expectation
support. We consume 4-8 bytes extra, but we will not need more
changes to support expectations which is a good idea.
Diffstat (limited to 'src/sync-notrack.c')
-rw-r--r-- | src/sync-notrack.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sync-notrack.c b/src/sync-notrack.c index a8cc6bf..06ad1f0 100644 --- a/src/sync-notrack.c +++ b/src/sync-notrack.c @@ -34,12 +34,14 @@ static struct alarm_block alive_alarm; struct cache_notrack { struct queue_node qnode; + struct cache_object *obj; }; static void cache_notrack_add(struct cache_object *obj, void *data) { struct cache_notrack *cn = data; queue_node_init(&cn->qnode, Q_ELEM_OBJ); + cn->obj = obj; } static void cache_notrack_del(struct cache_object *obj, void *data) @@ -191,19 +193,17 @@ static int tx_queue_xmit(struct queue_node *n, const void *data2) break; } case Q_ELEM_OBJ: { - struct cache_ftfw *cn; - struct cache_object *obj; + struct cache_notrack *cn; int type; struct nethdr *net; - cn = (struct cache_ftfw *)n; - obj = cache_data_get_object(STATE(mode)->internal->ct.data, cn); - type = object_status_to_network_type(obj);; - net = obj->cache->ops->build_msg(obj, type); + cn = (struct cache_notrack *)n; + type = object_status_to_network_type(cn->obj); + net = cn->obj->cache->ops->build_msg(cn->obj, type); multichannel_send(STATE_SYNC(channel), net); queue_del(n); - cache_object_put(obj); + cache_object_put(cn->obj); break; } } |