From 504439a02da3ca284e17b9755f3734e45a68cc44 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Gonzalez Date: Wed, 19 Jul 2017 15:05:28 +0200 Subject: 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 Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- include/rule.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/rule.h') 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; -- cgit v1.2.3