]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
cache: fix --echo with index/position
authorEric Garver <eric@garver.life>
Fri, 6 Sep 2019 00:33:01 +0000 (20:33 -0400)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 6 Sep 2019 00:35:21 +0000 (02:35 +0200)
Always call evaluate_cache_add() so it can set special flags - in this
case NFT_CACHE_UPDATE.

Fixes: 01e5c6f0ed03 ("src: add cache level flags")
Signed-off-by: Eric Garver <eric@garver.life>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/cache.c

index cffcbb623ced027e030ab49cc810966fcb971ed7..a778650ac133af33549104248469ef98d57f961a 100644 (file)
@@ -104,11 +104,9 @@ unsigned int cache_evaluate(struct nft_ctx *nft, struct list_head *cmds)
                case CMD_ADD:
                case CMD_INSERT:
                case CMD_CREATE:
-                       if (nft_output_echo(&nft->output)) {
-                               flags = NFT_CACHE_FULL;
-                               break;
-                       }
                        flags = evaluate_cache_add(cmd, flags);
+                       if (nft_output_echo(&nft->output))
+                               flags |= NFT_CACHE_FULL;
                        break;
                case CMD_REPLACE:
                        flags = NFT_CACHE_FULL;