netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] src: fix flush chain cache flag
@ 2019-07-30 13:33 Laura Garcia Liebana
  0 siblings, 0 replies; only message in thread
From: Laura Garcia Liebana @ 2019-07-30 13:33 UTC (permalink / raw)
  To: netfilter-devel

After the new cache system, nft raises a table error
flushing a chain in a transaction.

 # nft "flush chain ip nftlb filter-newfarm ; \
    add rule ip nftlb filter-newfarm update \
    @persist-newfarm {  ip saddr : ct mark } ; \
    flush chain ip nftlb nat-newfarm"
 Error: No such file or directory
 flush chain ip nftlb filter-newfarm ; add rule ip nftlb (...)
                                                   ^^^^^

This patch sets the cache flag properly to save this
case.

Fixes: 01e5c6f0ed031 ("src: add cache level flags")
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
 src/cache.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/cache.c b/src/cache.c
index 0d38034e..6f5fc342 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -71,6 +71,9 @@ static unsigned int evaluate_cache_flush(struct cmd *cmd, unsigned int flags)
 	case CMD_OBJ_METER:
 		flags |= NFT_CACHE_SET;
 		break;
+	case CMD_OBJ_CHAIN:
+		flags |= NFT_CACHE_CHAIN;
+		break;
 	case CMD_OBJ_RULESET:
 		flags |= NFT_CACHE_FLUSHED;
 		break;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-30 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 13:33 [PATCH nft] src: fix flush chain cache flag Laura Garcia Liebana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).