Skip to content

Two bugfixes around prefixes in sets

Phil Sutter netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4segtree: Fix missing expires value in prefixessrc/segtree.c+1 -10 replies
2/4segtree: Use expr_clone in get_set_interval_*()src/segtree.c+2 -60 replies
3/4segtree: Merge get_set_interval_find() and get_set_interval_end()src/segtree.c+16 -477 replies
4/4segtree: Fix get element command with prefixessrc/segtree.c tests/shell/testcases/sets/0034get_element_0+34 -180 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [nft PATCH 0/4] Two bugfixes around prefixes in sets

Patch 1 fixes a pretty obvious typo, leading to prefixes not showing their expiry time.

The remaining patches deal with wrong behaviour of 'get element' command when looking up prefixes. This could have been simple, 'get element' would return the prefix address but prefix length was missing.

While digging through the code, I eventually found out that get_set_interval_find() and get_set_interval_end() didn't respect prefix elements but cared about range elements only.

I am still not entirely sure how the code really works and why everything is needed, but the test case added in patch 4 and some debug output showed that things could be simplified quite a bit. Since this also streamlined adding prefix support, I went ahead with it.

Phil Sutter (4):
segtree: Fix missing expires value in prefixes
segtree: Use expr_clone in get_set_interval_*()
segtree: Merge get_set_interval_find() and get_set_interval_end()
segtree: Fix get element command with prefixes

 src/segtree.c                                | 70 +++++---------------
 tests/shell/testcases/sets/0034get_element_0 | 51 +++++++++-----
 2 files changed, 51 insertions(+), 70 deletions(-)
Signature · 1 line
2.25.1