[PATCH 1/2] cache: fix --echo with index/position

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 src/cache.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/cache.c b/src/cache.c
index cffcbb623ced..a778650ac133 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -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;
-- 
2.20.1




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux