Skip to contentSkip to conversation

src: json: fix synproxy flag parser typo

PATCH Applied Fernando Fernandez Mancera 2 participants 4 messages Jul 17, 2019 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 src: json: fix synproxy flag parser typo

---
 src/parser_json.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
src/parser_json.c +4 -4
index 42893c2..76c0a5c 100644
@@ -2197,7 +2197,7 @@ static int json_parse_synproxy_flag(struct json_ctx *ctx,
 	assert(flags);
 
 	if (!json_is_string(root)) {
-		json_error(ctx, "Invalid log flag type %s, expected string.",
+		json_error(ctx, "Invalid synproxy flag type %s, expected string.",
 			   json_typename(root));
 		return 1;
 	}
@@ -2208,7 +2208,7 @@ static int json_parse_synproxy_flag(struct json_ctx *ctx,
 			return 0;
 		}
 	}
-	json_error(ctx, "Unknown log flag '%s'.", flag);
+	json_error(ctx, "Unknown synproxy flag '%s'.", flag);
 	return 1;
 }
 
@@ -2222,13 +2222,13 @@ static int json_parse_synproxy_flags(struct json_ctx *ctx, json_t *root)
 		json_parse_synproxy_flag(ctx, root, &flags);
 		return flags;
 	} else if (!json_is_array(root)) {
-		json_error(ctx, "Invalid log flags type %s.",
+		json_error(ctx, "Invalid synproxy flags type %s.",
 			   json_typename(root));
 		return -1;
 	}
 	json_array_foreach(root, index, value) {
 		if (json_parse_synproxy_flag(ctx, value, &flags))
-			json_error(ctx, "Parsing log flag at index %zu failed.",
+			json_error(ctx, "Parsing synproxy flag at index %zu failed.",
 				   index);
 	}
 	return flags;
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 tests: py: add missing json outputs

Fixes 1188a69604c3 ("src: introduce SYNPROXY matching")
---
 tests/py/inet/synproxy.t.json | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
tests/py/inet/synproxy.t.json +25 -0
index 313fa9f..92c69d7 100644
@@ -69,3 +69,28 @@
         }
     }
 ]
+
+# synproxy mss 1460 wscale 5 timestamp sack-perm
+[
+    {
+        "synproxy": {
+            "flags": [
+                "timestamp",
+                "sack-perm"
+            ],
+            "mss": 1460,
+            "wscale": 5
+        }
+    }
+]
+
+# synproxy sack-perm
+[
+    {
+        "synproxy": {
+            "flags": [
+                "sack-perm"
+            ]
+        }
+    }
+]
Signature · 1 line
2.20.1
#2 lore raw

Re: [PATCH 2/2 nft] tests: py: add missing json outputs

also applied, thanks.