summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnatole Denis <anatole@rezel.net>2016-12-01 11:50:16 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2016-12-01 12:30:56 +0100
commit7988e426eb7b12d1f266ff47e6704541585f3b46 (patch)
tree0a88ec034c9ffbdcdd99b7104b41eb6eda5d8a58 /src
parent3b7a8a102c076eb015cf779613b06458d3d420b8 (diff)
rule: Introduce helper function cache_flush
cache_release empties the cache, and marks it as uninitialized. Add cache_flush, which does the same, except it keeps the cache initialized, eg. after a "nft flush ruleset" when empty is the correct state of the cache. Signed-off-by: Anatole Denis <anatole@rezel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/rule.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rule.c b/src/rule.c
index 8c58bfa6..8710767b 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -157,7 +157,7 @@ replay:
return 0;
}
-void cache_release(void)
+void cache_flush(void)
{
struct table *table, *next;
@@ -165,6 +165,11 @@ void cache_release(void)
list_del(&table->list);
table_free(table);
}
+}
+
+void cache_release(void)
+{
+ cache_flush();
cache_initialized = false;
}