* [nft PATCH] parser_json: Fix checking of parse_policy() return code
@ 2019-10-21 14:40 Phil Sutter
2019-10-21 15:59 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2019-10-21 14:40 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel, Fernando Fernandez Mancera
The function was changed to return an expression or NULL but error
checking wasn't adjusted while doing so.
Fixes: dba4a9b4b5fe2 ("src: allow variable in chain policy")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
src/parser_json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/parser_json.c b/src/parser_json.c
index 55dbc177cc98d..fe0c5df98f5d4 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -2630,7 +2630,7 @@ static struct cmd *json_parse_cmd_add_chain(struct json_ctx *ctx, json_t *root,
chain->dev = xstrdup(chain->dev);
if (!json_unpack(root, "{s:s}", "policy", &policy)) {
chain->policy = parse_policy(policy);
- if (chain->policy < 0) {
+ if (!chain->policy) {
json_error(ctx, "Unknown policy '%s'.", policy);
chain_free(chain);
return NULL;
--
2.23.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [nft PATCH] parser_json: Fix checking of parse_policy() return code
2019-10-21 14:40 [nft PATCH] parser_json: Fix checking of parse_policy() return code Phil Sutter
@ 2019-10-21 15:59 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2019-10-21 15:59 UTC (permalink / raw)
To: Phil Sutter; +Cc: netfilter-devel, Fernando Fernandez Mancera
On Mon, Oct 21, 2019 at 04:40:55PM +0200, Phil Sutter wrote:
> The function was changed to return an expression or NULL but error
> checking wasn't adjusted while doing so.
>
> Fixes: dba4a9b4b5fe2 ("src: allow variable in chain policy")
> Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-21 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21 14:40 [nft PATCH] parser_json: Fix checking of parse_policy() return code Phil Sutter
2019-10-21 15:59 ` Pablo Neira Ayuso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.