summaryrefslogtreecommitdiffstats
path: root/src/cache.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-01-25 17:53:02 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2009-01-25 17:53:02 +0100
commit1c9faf8c218bc7ff4617557383e4116f1adb11e5 (patch)
treef189019456f3399d3a47d3471f406956381c65b7 /src/cache.c
parenteec8fdf57f34fe0d80b884ad0e376ed24c63ffcc (diff)
cache: move lifetime feature to main cache code
The lifetime feature is used by all working modes, it is useful to know how long it has been an entry living in the cache. This patch moves the lifetime feature to the main caching code. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cache.c b/src/cache.c
index a5f37dd..71825e1 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -26,6 +26,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
static uint32_t
__hash4(const struct nf_conntrack *ct, const struct hashtable *table)
@@ -94,7 +95,6 @@ static int compare(const void *data1, const void *data2)
struct cache_feature *cache_feature[CACHE_MAX_FEATURE] = {
[TIMER_FEATURE] = &timer_feature,
- [LIFETIME_FEATURE] = &lifetime_feature,
[WRITE_THROUGH_FEATURE] = &writethrough_feature,
};
@@ -249,6 +249,7 @@ static int __add(struct cache *c, struct cache_object *obj, int id)
c->extra->add(obj, ((char *) obj) + c->extra_offset);
c->stats.active++;
+ obj->lifetime = time(NULL);
obj->status = C_OBJ_NEW;
obj->refcnt++;
return 0;