]> git.ipfire.org Git - thirdparty/nftables.git/commit
json: Fix tproxy support regarding latest changes
authorPhil Sutter <phil@nwl.cc>
Thu, 9 May 2019 11:35:41 +0000 (13:35 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 9 May 2019 15:19:50 +0000 (17:19 +0200)
commit1b8953e75c20437b5c563d86c3ba11d1b24e3ec4
tree6d71a2ffbede3d03f74d350a0a9feb81551f7b7d
parent43cb4f27da74184da350c62cad8dd573590b09c6
json: Fix tproxy support regarding latest changes

Family may be specified also if no address is given at the same time,
make parser/printer tolerant to that. Also fix for missing/incorrect
JSON equivalents in tests/py.

While being at it, fix two issues in non-JSON tests:

* Ruleset is printed in numeric mode, so use 'l4proto 6' instead of
  'l4proto tcp' in rules to avoid having to specify expected output for
  that unrelated bit.

* In ip and ip6 family tables, family parameter is not deserialized on
  output.

Fixes: 3edb96200690b ("parser_bison: missing tproxy syntax with port only for inet family")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/json.c
src/parser_json.c
tests/py/inet/tproxy.t
tests/py/inet/tproxy.t.json
tests/py/inet/tproxy.t.payload
tests/py/ip/tproxy.t
tests/py/ip/tproxy.t.json
tests/py/ip/tproxy.t.json.output [new file with mode: 0644]
tests/py/ip6/tproxy.t
tests/py/ip6/tproxy.t.json
tests/py/ip6/tproxy.t.json.output [new file with mode: 0644]