[nft PATCH 3/4] parser_json: Fix typo in ct timeout policy parser

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

 



Parser expects an object in policy property and json_is_object() returns
true if given parameter is an object. The check was inverse by accident.

Fixes: c82a26ebf7e9f ("json: Add ct timeout support")
Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 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 53017935eba53..01f340802bec9 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -2782,7 +2782,7 @@ static int json_parse_ct_timeout_policy(struct json_ctx *ctx,
 	if (!json_unpack(root, "{s:o}", "policy", &tmp))
 		return 0;
 
-	if (json_is_object(tmp)) {
+	if (!json_is_object(tmp)) {
 		json_error(ctx, "Invalid ct timeout policy.");
 		return 1;
 	}
-- 
2.21.0




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

  Powered by Linux