From 7988e426eb7b12d1f266ff47e6704541585f3b46 Mon Sep 17 00:00:00 2001 From: Anatole Denis Date: Thu, 1 Dec 2016 11:50:16 +0100 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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; } -- cgit v1.2.3