unbreak element deletion in map with ranges
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | evaluate: set on expr->len for catchall set elementssrc/ | +11 | 0 replies | |
| 2/4 | segtree: set on EXPR_F_KERNEL flag for catchall elements in the cachesrc/ | +3 | 0 replies | |
| 3/4 | intervals: fix element deletions with mapssrc/ | +18 | 0 replies | |
| 4/4 | tests: shell: cover set element deletion in mapstests/ tests/ tests/ +1 more | +87 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH nft 0/4] unbreak element deletion in map with ranges
Hi,
The following series fixes element deletion in maps with ranges (ie. those with interval flag set on):
# nft delete element ip filter mymap { 0-2400000 }
BUG: invalid range expression type set element
nft: src/expression.c:1472: range_expr_value_low: Assertion `0' failed.
AbortedSame BUG notice is reported when deleting catchall in maps with ranges, this is related to the src/interval.c code that deals with element deletions.
Patch #1 sets on expr->len for catchall elements since this is required
by map element deletion, which relies on mergesort.
Patch #2 sets on EXPR_F_KERNEL for catchall elements which is required
by map element deletion to identify matching elements already in the kernel.
Patch #3 fixes set element deletion in maps with ranges. Use expr->left
to fetch the key range but still expr->flags to fetch EXPR_F_REMOVE and the expression itself when moving elements to the purge list.
Patch #4 extends test coverage for this usecase.
Pablo Neira Ayuso (4):
evaluate: set on expr->len for catchall set elements
segtree: set on EXPR_F_KERNEL flag for catchall elements in the cache
intervals: fix element deletions with maps
tests: shell: cover set element deletion in maps
src/evaluate.c | 12 ++++++- src/intervals.c | 31 +++++++++------- src/segtree.c | 4 ++- tests/shell/testcases/maps/delete_element | 28 +++++++++++++++ .../testcases/maps/delete_element_catchall | 35 +++++++++++++++++++ .../maps/dumps/delete_elem_catchall.nft | 12 +++++++ .../testcases/maps/dumps/delete_element.nft | 12 +++++++ 7 files changed, 119 insertions(+), 15 deletions(-) create mode 100755 tests/shell/testcases/maps/delete_element create mode 100755 tests/shell/testcases/maps/delete_element_catchall create mode 100644 tests/shell/testcases/maps/dumps/delete_elem_catchall.nft create mode 100644 tests/shell/testcases/maps/dumps/delete_element.nft
Signature · 1 line
2.30.2