netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] libnftables: check for errors after evaluations
@ 2019-06-07 12:22 Pablo Neira Ayuso
  0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2019-06-07 12:22 UTC (permalink / raw)
  To: netfilter-devel

Check for state->nerrs after evaluation to restore error reporting when
evaluation fails.

Fixes: df2f746fb4cf ("libnftables: keep evaluating until parser_max_errors")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
Sorry! I pushed out df2f746fb4cf too fast.

 src/libnftables.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/libnftables.c b/src/libnftables.c
index e9dc03cf2909..abd133bee127 100644
--- a/src/libnftables.c
+++ b/src/libnftables.c
@@ -398,6 +398,9 @@ static int nft_evaluate(struct nft_ctx *nft, struct list_head *msgs,
 			return -1;
 	}
 
+	if (nft->state->nerrs)
+		return -1;
+
 	list_for_each_entry(cmd, cmds, list)
 		nft_cmd_expand(cmd);
 
-- 
2.11.0


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

only message in thread, other threads:[~2019-06-07 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-07 12:22 [PATCH nft] libnftables: check for errors after evaluations 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).