summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-05-28 18:51:01 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-06-01 09:16:48 +0200
commit25ccb4587de81e1b348e4e2f5404e70097ea8ec9 (patch)
tree7a03f4c44a777feecedac089c7203c4591cb6381 /tests
parent1c01c8e24e749e7f61b3cd1f4cf4ca8dc32ffd65 (diff)
JSON: Review set elem expressions
* There is no need to prefix element-specific properties with 'elem_', they can't conflict. * In json_parse_set_stmt(), searching for above properties is pointless since that's already done by called function. * Fix potential NULL-pointer deref in json_parse_set_elem_expr_stmt(): json_parse_flagged_expr() may return NULL. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/py/ip/flowtable.t.json2
-rw-r--r--tests/py/ip/flowtable.t.json.output24
-rw-r--r--tests/py/ip6/flowtable.t.json4
3 files changed, 27 insertions, 3 deletions
diff --git a/tests/py/ip/flowtable.t.json b/tests/py/ip/flowtable.t.json
index ca4b5f61..5e11172e 100644
--- a/tests/py/ip/flowtable.t.json
+++ b/tests/py/ip/flowtable.t.json
@@ -4,7 +4,7 @@
"meter": {
"key": {
"elem": {
- "elem_timeout": 30,
+ "timeout": 30,
"val": {
"payload": {
"field": "saddr",
diff --git a/tests/py/ip/flowtable.t.json.output b/tests/py/ip/flowtable.t.json.output
new file mode 100644
index 00000000..004349a8
--- /dev/null
+++ b/tests/py/ip/flowtable.t.json.output
@@ -0,0 +1,24 @@
+# meter xyz { ip saddr timeout 30s counter}
+[
+ {
+ "meter": {
+ "key": {
+ "elem": {
+ "timeout": 30,
+ "val": {
+ "payload": {
+ "field": "saddr",
+ "name": "ip"
+ }
+ }
+ }
+ },
+ "name": "xyz",
+ "size": 65535,
+ "stmt": {
+ "counter": null
+ }
+ }
+ }
+]
+
diff --git a/tests/py/ip6/flowtable.t.json b/tests/py/ip6/flowtable.t.json
index e3d05339..863669eb 100644
--- a/tests/py/ip6/flowtable.t.json
+++ b/tests/py/ip6/flowtable.t.json
@@ -4,7 +4,7 @@
"meter": {
"key": {
"elem": {
- "elem_timeout": 600,
+ "timeout": 600,
"val": {
"concat": [
{
@@ -34,7 +34,7 @@
"meter": {
"key": {
"elem": {
- "elem_timeout": 600,
+ "timeout": 600,
"val": {
"concat": [
{