summaryrefslogtreecommitdiffstats
path: root/src/cli.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2017-10-23 17:33:17 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-10-24 15:23:55 +0200
commit2a3f699d99898c50c51987f8fb64cd5b11ad0dd6 (patch)
tree63a383caa67527ec57f52009e73d3048b9048cf1 /src/cli.c
parent49900d448ac95ecabd038a9936d467d6e37aacec (diff)
libnftables: Introduce nft_ctx_flush_cache()
This allows an application to explicitly flush caches associated with a given nft context, as seen in cli_complete(). Note that this is a bit inconsistent in that it releases the global interface cache, but nft_ctx_free() does the same so at least it's not a regression. Note that there is no need for explicit cache update routine since cache is populated during command execution depending on whether it is needed or not. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cli.c b/src/cli.c
index cadc3af6..3174cfed 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -140,8 +140,7 @@ static void cli_complete(char *line)
nft_run(cli_nft, cli_nf_sock, scanner, state, &msgs);
erec_print_list(&cli_nft->output, &msgs, cli_nft->debug_mask);
xfree(line);
- cache_release(&cli_nft->cache);
- iface_cache_release();
+ nft_ctx_flush_cache(cli_nft);
}
static char **cli_completion(const char *text, int start, int end)