summaryrefslogtreecommitdiffstats
path: root/src/cache.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-01-04 14:31:41 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2012-01-10 01:54:45 +0100
commit79ab299bfb20b7fc1982ca90d77d8b908b824fea (patch)
treea7fe20e7685f967da400675c42fce9f6f634a30f /src/cache.c
parent598e465087365db1fa36b67aa53d291e400ec5b1 (diff)
conntrackd: simplify cache_get_extra function
This patch simplifies cache_get_extra which now takes only one parameter that is the cache_object. With it, the extra area can be calculated. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cache.c b/src/cache.c
index efdab0e..f515ba0 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -308,9 +308,9 @@ struct cache_object *cache_data_get_object(struct cache *c, void *data)
return (struct cache_object *)((char*)data - c->extra_offset);
}
-void *cache_get_extra(struct cache *c, void *data)
+void *cache_get_extra(struct cache_object *obj)
{
- return (char*)data + c->extra_offset;
+ return (char*)obj + obj->cache->extra_offset;
}
void cache_stats(const struct cache *c, int fd)