summaryrefslogtreecommitdiff
path: root/src/cache_iterators.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-01-25 17:51:18 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2009-01-25 17:51:18 +0100
commit8d689ebb67c511f5c03acdfc2226156d5f87c319 (patch)
treec07a21e06e1b58b5ebc4cb11f28e96102064b251 /src/cache_iterators.c
parente6732c96ffd9baaaa84dab763ff6e600bf6abc95 (diff)
downloadconntrack-tools-8d689ebb67c511f5c03acdfc2226156d5f87c319.tar.gz
conntrack-tools-8d689ebb67c511f5c03acdfc2226156d5f87c319.zip
cache: mangle timeout inside nl_*_conntrack() functions
This patch moves the timeout mangling inside nl_*_conntrack(). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/cache_iterators.c')
-rw-r--r--src/cache_iterators.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/cache_iterators.c b/src/cache_iterators.c
index 379deed..9b54ea1 100644
--- a/src/cache_iterators.c
+++ b/src/cache_iterators.c
@@ -105,14 +105,8 @@ __do_commit_step(struct __commit_container *tmp, struct cache_object *obj)
int ret, retry = 1;
struct nf_conntrack *ct = obj->ct;
- /*
- * Set a reduced timeout for candidate-to-be-committed
- * conntracks that live in the external cache
- */
- nfct_set_attr_u32(ct, ATTR_TIMEOUT, CONFIG(commit_timeout));
-
retry:
- if (nl_create_conntrack(tmp->h, ct) == -1) {
+ if (nl_create_conntrack(tmp->h, ct, CONFIG(commit_timeout)) == -1) {
if (errno == EEXIST && retry == 1) {
ret = nl_destroy_conntrack(tmp->h, ct);
if (ret == 0 || (ret == -1 && errno == ENOENT)) {
@@ -223,9 +217,7 @@ static int do_reset_timers(void *data1, struct hashtable_node *n)
if (current_timeout < CONFIG(purge_timeout))
break;
- nfct_set_attr_u32(tmp, ATTR_TIMEOUT, CONFIG(purge_timeout));
-
- if (nl_update_conntrack(h, tmp) == -1) {
+ if (nl_update_conntrack(h, tmp, CONFIG(purge_timeout)) == -1) {
if (errno == ETIME || errno == ENOENT)
break;
dlog(LOG_ERR, "reset-timers-upd: %s", strerror(errno));