summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-01-16 20:01:56 +0000
committerPatrick McHardy <kaber@trash.net>2014-01-16 20:01:56 +0000
commitbea7aab38f305bb8c2e400d575e6bd0a3c6bbc1f (patch)
treea78c4144d756cd54fdb75c143be51a307884af22 /src/rule.c
parent11884cfb1c0432cc455ff8e3269500e819e0c434 (diff)
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 <kaber@trash.net>
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c6
1 files changed, 5 insertions, 1 deletions
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 = ",";