]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
statement: incorrect spacing in set reference
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Aug 2018 07:52:11 +0000 (09:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Aug 2018 07:52:11 +0000 (09:52 +0200)
        chain y {
                type filter hook output priority filter; policy accept;
                update @xyz{ ip daddr }
                          ^^

Missing space between set reference and the element statement. This does
not break restoring the ruleset but it is inconsistent to the viewer.

There is also an extra space after the element statement that is
enclosed in brackets.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/statement.c

index 3040476fdfa1a15f1a3c94401c4bb6502ac2cdaf..cec83c19e52900f59782ac5404403105e269b5ee 100644 (file)
@@ -630,7 +630,7 @@ static void set_stmt_print(const struct stmt *stmt, struct output_ctx *octx)
        expr_print(stmt->set.set, octx);
        nft_print(octx, " { ");
        expr_print(stmt->set.key, octx);
-       nft_print(octx, " } ");
+       nft_print(octx, " }");
 }
 
 static void set_stmt_destroy(struct stmt *stmt)
@@ -656,11 +656,11 @@ static void map_stmt_print(const struct stmt *stmt, struct output_ctx *octx)
 {
        nft_print(octx, "%s ", set_stmt_op_names[stmt->map.op]);
        expr_print(stmt->map.set, octx);
-       nft_print(octx, "{ ");
+       nft_print(octx, " { ");
        expr_print(stmt->map.map->map->key, octx);
        nft_print(octx, " : ");
        expr_print(stmt->map.map->mappings, octx);
-       nft_print(octx, " } ");
+       nft_print(octx, " }");
 }
 
 static void map_stmt_destroy(struct stmt *stmt)