summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorArturo Borrero Gonzalez <arturo@netfilter.org>2017-07-19 15:05:28 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-07-19 19:24:39 +0200
commit504439a02da3ca284e17b9755f3734e45a68cc44 (patch)
tree070a1f868108bcc45b0a3cf238abcf4a853522d6 /include
parent6089630f54cecada1fcb91e12ad5eb1811010e48 (diff)
monitor: Fix printing of range elements in named sets
If you add set elements to interval sets, the output is wrong. Fix this by caching first element of the range (first event), then wait for the second element of the range (second event) to print them both at the same time. We also avoid printing the first null element required in the RB tree. Before this patch: % nft add element t s {10-20, 30-40} add element ip t s { 0 } add element ip t s { 10 } add element ip t s { ftp } add element ip t s { 30 } add element ip t s { 41 } After this patch: % nft add element t s {10-20, 30-40} add element ip t s { 10-20 } add element ip t s { 30-40 } Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org> Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/rule.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/rule.h b/include/rule.h
index a25e99bd..6acd5fa8 100644
--- a/include/rule.h
+++ b/include/rule.h
@@ -217,6 +217,7 @@ extern struct rule *rule_lookup(const struct chain *chain, uint64_t handle);
* @datalen: mapping data len
* @objtype: mapping object type
* @init: initializer
+ * @rg_cache: cached range element (left)
* @policy: set mechanism policy
* @desc: set mechanism desc
*/
@@ -234,6 +235,7 @@ struct set {
unsigned int datalen;
uint32_t objtype;
struct expr *init;
+ struct expr *rg_cache;
uint32_t policy;
struct {
uint32_t size;