mark statement support for non-constant expression
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest12 patches 2 repliesIn review
- v28 patches 0 repliesSuperseded
- v19 patches 0 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | netlink_delinearize: correct type and byte-order of shiftssrc/ | +11 | 0 replies | |
| 2/12 | evaluate: support shifts larger than the width of the left operandinclude/ src/ src/ | +47 | 0 replies | |
| 3/12 | evaluate: don't eval unary argumentssrc/ | +2 | 0 replies | |
| 4/12 | evaluate: relax type-checking for integer arguments in mark statementssrc/ tests/ tests/ +1 more | +41 | 0 replies | |
| 5/12 | evaluate: set up integer type to shift expressionsrc/ | +1 | 1 reply | |
| 6/12 | evaluate: honor statement length in integer evaluationsrc/ | +8 | 0 replies | |
| 7/12 | evaluate: honor statement length in bitwise evaluationsrc/ | +23 | 1 reply | |
| 8/12 | netlink_delinerize: incorrect byteorder in mark statement listingsrc/ | +14 | 0 replies | |
| 9/12 | tests: py: add test-cases for ct and packet mark payload expressionstests/ tests/ tests/ +9 more | +483 | 0 replies | |
| 10/12 | tests: shell: rename and move bitwise test-casestests/ tests/ tests/ +1 more | +4 | 0 replies | |
| 11/12 | tests: shell: add test-cases for ct and packet mark payload expressionstests/ tests/ tests/ +13 more | +136 | 0 replies | |
| 12/12 | tests: py: extend test-cases for mark statements with bitwise expressionstests/ tests/ tests/ +3 more | +234 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH nft,v3 00/12] mark statement support for non-constant expression
Hi,
This is v3 of the following patchset:
https://marc.info/?l=netfilter-devel&m=167904710124404&w=2
this takes over the initial effort from Jeremy Sowden to enhance mark statements support for variable expression.
This round emphasizes on the support for bitwise expression (not only shift).
No kernel updates are required in this batch.
Patch #1 no changes.
Patch #2 changes to sets ctx->stmt_len for meta and ct only, reset
ctx->stmt_len in expr_evaluate_map() to avoid interference with map evaluation.
Patch #3 no changes.
Patch #4 no changes.
Patch #5 new in this series, missing type in shift evaluation.
This is required to evaluate constant shift, eg. 1 << 1
which is reduced at evaluation step to 0x2.Patch #6 disable lhs maximum length cap when ctx->stmt_len is available.
This allows for: meta mark set ip dscp | 0xff000000
Patch #7 honor ctx->stmt_len in bitwise evaluation, otherwise evaluation
results in incorrect bytecode. This assumes host byteorder for the statement, which is fine at this stage since only ct and meta statement are supported.
Patch #8 adjust byteorder in delinearize path if bitwise length hints
that it refers to the statement length. This assumes host byteorder, in this future, when this support is generalized this requires to infer the byteorder from the statement that has been used.
Patch #9-#12 tests already posted in the previous batch and new ones.
Jeremy Sowden (5):
netlink_delinearize: correct type and byte-order of shifts
evaluate: don't eval unary arguments
tests: py: add test-cases for ct and packet mark payload expressions
tests: shell: rename and move bitwise test-cases
tests: shell: add test-cases for ct and packet mark payload expressions
Pablo Neira Ayuso (7):
evaluate: support shifts larger than the width of the left operand
evaluate: relax type-checking for integer arguments in mark statements
evaluate: set up integer type to shift expression
evaluate: honor statement length in integer evaluation
evaluate: honor statement length in bitwise evaluation
netlink_delinerize: incorrect byteorder in mark statement listing
tests: py: extend test-cases for mark statements with bitwise expressions
include/rule.h | 1 +
src/evaluate.c | 119 +++++--
src/netlink_delinearize.c | 35 ++-
tests/py/ip/ct.t | 6 +
tests/py/ip/ct.t.json | 154 +++++++++
tests/py/ip/ct.t.payload | 50 +++
tests/py/ip/meta.t | 5 +
tests/py/ip/meta.t.json | 78 +++++
tests/py/ip/meta.t.payload | 25 ++
tests/py/ip6/ct.t | 9 +
tests/py/ip6/ct.t.json | 293 ++++++++++++++++++
tests/py/ip6/ct.t.payload | 46 +++
tests/py/ip6/meta.t | 3 +
tests/py/ip6/meta.t.json | 58 ++++
tests/py/ip6/meta.t.payload | 20 ++
.../0040mark_binop_0} | 2 +-
.../0040mark_binop_1} | 2 +-
.../shell/testcases/bitwise/0040mark_binop_2 | 11 +
.../shell/testcases/bitwise/0040mark_binop_3 | 11 +
.../shell/testcases/bitwise/0040mark_binop_4 | 11 +
.../shell/testcases/bitwise/0040mark_binop_5 | 11 +
.../shell/testcases/bitwise/0040mark_binop_6 | 11 +
.../shell/testcases/bitwise/0040mark_binop_7 | 11 +
.../shell/testcases/bitwise/0040mark_binop_8 | 11 +
.../shell/testcases/bitwise/0040mark_binop_9 | 11 +
.../dumps/0040mark_binop_0.nft} | 2 +-
.../dumps/0040mark_binop_1.nft} | 2 +-
.../bitwise/dumps/0040mark_binop_2.nft | 6 +
.../bitwise/dumps/0040mark_binop_3.nft | 6 +
.../bitwise/dumps/0040mark_binop_4.nft | 6 +
.../bitwise/dumps/0040mark_binop_5.nft | 6 +
.../bitwise/dumps/0040mark_binop_6.nft | 6 +
.../bitwise/dumps/0040mark_binop_7.nft | 6 +
.../bitwise/dumps/0040mark_binop_8.nft | 6 +
.../bitwise/dumps/0040mark_binop_9.nft | 6 +
35 files changed, 1004 insertions(+), 42 deletions(-)
create mode 100644 tests/py/ip6/ct.t
create mode 100644 tests/py/ip6/ct.t.json
create mode 100644 tests/py/ip6/ct.t.payload
rename tests/shell/testcases/{chains/0040mark_shift_0 => bitwise/0040mark_binop_0} (68%)
rename tests/shell/testcases/{chains/0040mark_shift_1 => bitwise/0040mark_binop_1} (70%)
create mode 100755 tests/shell/testcases/bitwise/0040mark_binop_2
create mode 100755 tests/shell/testcases/bitwise/0040mark_binop_3
create mode 100755 tests/shell/testcases/bitwise/0040mark_binop_4
create mode 100755 tests/shell/testcases/bitwise/0040mark_binop_5
create mode 100755 tests/shell/testcases/bitwise/0040mark_binop_6
create mode 100755 tests/shell/testcases/bitwise/0040mark_binop_7
create mode 100755 tests/shell/testcases/bitwise/0040mark_binop_8
create mode 100755 tests/shell/testcases/bitwise/0040mark_binop_9
rename tests/shell/testcases/{chains/dumps/0040mark_shift_0.nft => bitwise/dumps/0040mark_binop_0.nft} (58%)
rename tests/shell/testcases/{chains/dumps/0040mark_shift_1.nft => bitwise/dumps/0040mark_binop_1.nft} (64%)
create mode 100644 tests/shell/testcases/bitwise/dumps/0040mark_binop_2.nft
create mode 100644 tests/shell/testcases/bitwise/dumps/0040mark_binop_3.nft
create mode 100644 tests/shell/testcases/bitwise/dumps/0040mark_binop_4.nft
create mode 100644 tests/shell/testcases/bitwise/dumps/0040mark_binop_5.nft
create mode 100644 tests/shell/testcases/bitwise/dumps/0040mark_binop_6.nft
create mode 100644 tests/shell/testcases/bitwise/dumps/0040mark_binop_7.nft
create mode 100644 tests/shell/testcases/bitwise/dumps/0040mark_binop_8.nft
create mode 100644 tests/shell/testcases/bitwise/dumps/0040mark_binop_9.nftSignature · 1 line
2.30.2