Skip to contentSkip to conversation

rule: delete extra space in rule indentation

PATCH Applied Arturo Borrero Gonzalez 3 participants 3 messages Mar 18, 2015 – Mar 19, 2015 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rule: delete extra space in rule indentation

Annoying extra space in rule indentation:

Example before this patch:

table ip6 test_table {
	chain test_chain {
		 counter tcp dport { 22, 80, 443} accept # handle 1
		^
	}
}

Example after this patch:

table ip6 test_table {
	chain test_chain {
		counter tcp dport { 22, 80, 443} accept # handle 1
	}
}

---
v2: include examples in patch description.

 src/rule.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/rule.c +2 -2
index 8d76fd0..9403c1e 100644
@@ -237,11 +237,11 @@ void rule_print(const struct rule *rule)
 	const struct stmt *stmt;
 
 	list_for_each_entry(stmt, &rule->stmts, list) {
-		printf(" ");
 		stmt->ops->print(stmt);
+		printf(" ");
 	}
 	if (handle_output > 0)
-		printf(" # handle %" PRIu64, rule->handle.handle);
+		printf("# handle %" PRIu64, rule->handle.handle);
 }
 
 struct scope *scope_init(struct scope *scope, const struct scope *parent)
maintainer Applied
#1 lore raw
Quoted 11 lines · Arturo Borrero Gonzalez

Annoying extra space in rule indentation:

Example before this patch:

table ip6 test_table {
	chain test_chain {
		 counter tcp dport { 22, 80, 443} accept # handle 1
		^
	}
}
Quoted 7 lines

Example after this patch:

table ip6 test_table {
	chain test_chain {
		counter tcp dport { 22, 80, 443} accept # handle 1
	}
}

Applied, thanks.

#2 lore raw
Quoted 14 lines · Pablo Neira Ayuso
Quoted 13 lines · Arturo Borrero Gonzalez

Annoying extra space in rule indentation:

Example before this patch:

table ip6 test_table {
	chain test_chain {
		 counter tcp dport { 22, 80, 443} accept # handle 1
		^
	}
}

Example after this patch:

Quoted 7 lines
Quoted 5 lines
table ip6 test_table {
	chain test_chain {
		counter tcp dport { 22, 80, 443} accept # handle 1
	}
}

Applied, thanks.

We now have misaligned output, f.i.

type filter hook output priority 0; policy accept;
ip daddr @test counter packets 14 bytes 1176

Arturo, please check the remaining print functions and adjust them accordingly.