diff options
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -367,6 +367,8 @@ void set_free(struct set *set) return; if (set->init != NULL) expr_free(set->init); + if (set->comment) + xfree(set->comment); handle_free(&set->handle); stmt_free(set->stmt); expr_free(set->key); @@ -584,6 +586,13 @@ static void set_print_declaration(const struct set *set, time_print(set->gc_int, octx); nft_print(octx, "%s", opts->stmt_separator); } + + if (set->comment) { + nft_print(octx, "%s%scomment \"%s\"%s", + opts->tab, opts->tab, + set->comment, + opts->stmt_separator); + } } static void do_set_print(const struct set *set, struct print_fmt_options *opts, |