netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] cache: fix --echo with index/position
@ 2019-09-06  0:33 Eric Garver
  2019-09-06  0:33 ` [PATCH 2/2] tests: shell: check that rule add with index works with echo Eric Garver
  2019-09-06  0:36 ` [PATCH 1/2] cache: fix --echo with index/position Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Garver @ 2019-09-06  0:33 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Pablo Neira Ayuso

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>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-06  0:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06  0:33 [PATCH 1/2] cache: fix --echo with index/position Eric Garver
2019-09-06  0:33 ` [PATCH 2/2] tests: shell: check that rule add with index works with echo Eric Garver
2019-09-06  0:36   ` Pablo Neira Ayuso
2019-09-06  0:36 ` [PATCH 1/2] cache: fix --echo with index/position Pablo Neira Ayuso

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).