diff options
author | Anatole Denis <anatole@rezel.net> | 2016-12-01 11:50:16 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-12-01 12:30:56 +0100 |
commit | 7988e426eb7b12d1f266ff47e6704541585f3b46 (patch) | |
tree | 0a88ec034c9ffbdcdd99b7104b41eb6eda5d8a58 /src/rule.c | |
parent | 3b7a8a102c076eb015cf779613b06458d3d420b8 (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/rule.c')
-rw-r--r-- | src/rule.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; } |