diff options
author | Patrick McHardy <kaber@trash.net> | 2014-01-16 20:01:56 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2014-01-16 20:01:56 +0000 |
commit | bea7aab38f305bb8c2e400d575e6bd0a3c6bbc1f (patch) | |
tree | a78c4144d756cd54fdb75c143be51a307884af22 /src/rule.c | |
parent | 11884cfb1c0432cc455ff8e3269500e819e0c434 (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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 = ","; |