From 0ca812ad41bf2d89073a43f8efd3ee712031e3cb Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 9 Nov 2017 13:24:57 +0100 Subject: libnftables: Flush iface cache after command execution Commit 94a945ffa81b7 ("libnftables: Get rid of explicit cache flushes") was a bit too optimistic in that it missed the remaining need to flush interface cache after each command in interactive mode - otherwise, newly added interfaces won't be recognized. Although cli.c only calls nft_run_cmd_from_buffer(), flush caches in nft_run_cmd_from_filename() as well for matters of consistency. Fixes: 94a945ffa81b7 ("libnftables: Get rid of explicit cache flushes") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/libnftables.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libnftables.c') diff --git a/src/libnftables.c b/src/libnftables.c index 0d04ec21..dc6a5fdf 100644 --- a/src/libnftables.c +++ b/src/libnftables.c @@ -290,6 +290,7 @@ int nft_run_cmd_from_buffer(struct nft_ctx *nft, char *buf, size_t buflen) erec_print_list(&nft->output, &msgs, nft->debug_mask); nft_ctx_set_output(nft, fp); scanner_destroy(scanner); + iface_cache_release(); return rc; } @@ -322,6 +323,7 @@ err: erec_print_list(&nft->output, &msgs, nft->debug_mask); nft_ctx_set_output(nft, fp); scanner_destroy(scanner); + iface_cache_release(); return rc; } -- cgit v1.2.3