From bea7aab38f305bb8c2e400d575e6bd0a3c6bbc1f Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Thu, 16 Jan 2014 20:01:56 +0000 Subject: set: make set initializer parsable If a set contains elements, the output is not parsable since the elements = { ... } is not understood by the parser. Fix this and also add support for creating constant sets (which only makes sense when using an initializer). Signed-off-by: Patrick McHardy --- src/rule.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index 0f7f4b51..9f6c04bb 100644 --- a/src/rule.c +++ b/src/rule.c @@ -100,8 +100,12 @@ void set_print(const struct set *set) printf(" : %s", set->datatype->name); printf("\n"); - if (set->flags & (SET_F_INTERVAL)) { + if (set->flags & (SET_F_CONSTANT | SET_F_INTERVAL)) { printf("\t\tflags "); + if (set->flags & SET_F_CONSTANT) { + printf("%sconstant", delim); + delim = ","; + } if (set->flags & SET_F_INTERVAL) { printf("%sinterval", delim); delim = ","; -- cgit v1.2.3