All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nft 0/2] Fix listing of sets containing unclosed address prefix intervals
@ 2022-09-18 17:22 Jeremy Sowden
  2022-09-18 17:22 ` [PATCH nft 1/2] segtree: refactor decomposition of closed intervals Jeremy Sowden
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jeremy Sowden @ 2022-09-18 17:22 UTC (permalink / raw)
  To: Netfilter Devel

The code which decomposes unclosed intervals in sets doesn't check for
prefixes.  This means that a set containing such a prefix (e.g.,
ff00::/8 or 192.0.0.0/2) is incorrectly listed:

  # nft list table ip6 t
  table ip6 t {
    chain c {
      ip6 saddr ff00::/8 drop
      ip6 saddr fe80::/10 drop
      ip6 saddr { fe80::/10, ff00::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff } drop
    }
  }
  # nft list table ip t
  table ip t {
    chain c {
      ip saddr 192.0.0.0/2 drop
      ip saddr 10.0.0.0/8 drop
      ip saddr { 10.0.0.0/8, 192.0.0.0-255.255.255.255 } drop
    }
  }

This patch-set refactors `interval_map_decompose` to use the same code
to handle unclosed intervals that is used for closed ones.

Jeremy Sowden (2):
  segtree: refactor decomposition of closed intervals
  segtree: fix decomposition of unclosed intervals containing address
    prefixes

 src/segtree.c                                 | 90 +++++++++----------
 .../sets/0071unclosed_prefix_interval_0       | 23 +++++
 .../dumps/0071unclosed_prefix_interval_0.nft  | 19 ++++
 3 files changed, 85 insertions(+), 47 deletions(-)
 create mode 100755 tests/shell/testcases/sets/0071unclosed_prefix_interval_0
 create mode 100644 tests/shell/testcases/sets/dumps/0071unclosed_prefix_interval_0.nft

-- 
2.35.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-21 20:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-18 17:22 [PATCH nft 0/2] Fix listing of sets containing unclosed address prefix intervals Jeremy Sowden
2022-09-18 17:22 ` [PATCH nft 1/2] segtree: refactor decomposition of closed intervals Jeremy Sowden
2022-09-18 17:22 ` [PATCH nft 2/2] segtree: fix decomposition of unclosed intervals containing address prefixes Jeremy Sowden
2022-09-21 11:48   ` Florian Westphal
2022-09-21 19:46     ` Jeremy Sowden
2022-09-21 20:26       ` Florian Westphal
2022-09-18 21:02 ` [PATCH nft 0/2] Fix listing of sets containing unclosed address prefix intervals Jeremy Sowden

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.