iptables-save: restore indent after last change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



parent 67f4e55f28abf2f666c0a0aa874d9421e91d6184
commit 5c79c4fa98e35426b836d468e80c3c5e7466ad8b
Author: Jan Engelhardt <jengelh@xxxxxxxxxx>
Date:   Wed Dec 24 20:32:26 2008 +0100

iptables-save: restore indent after last change

Signed-off-by: Jan Engelhardt <jengelh@xxxxxxxxxx>
---
 iptables-save.c |   67 +++++++++++++++++++++-------------------------
 1 files changed, 31 insertions(+), 36 deletions(-)

diff --git a/iptables-save.c b/iptables-save.c
index dce9185..ea52377 100644
--- a/iptables-save.c
+++ b/iptables-save.c
@@ -60,6 +60,7 @@ static int do_output(const char *tablename)
 {
 	struct iptc_handle *h;
 	const char *chain = NULL;
+	time_t now;
 
 	if (!tablename)
 		return for_each_table(&do_output);
@@ -69,49 +70,43 @@ static int do_output(const char *tablename)
 		exit_error(OTHER_PROBLEM, "Can't initialize: %s\n",
 			   iptc_strerror(errno));
 
-	{
-		time_t now = time(NULL);
-
-		printf("# Generated by iptables-save v%s on %s",
-		       XTABLES_VERSION, ctime(&now));
-		printf("*%s\n", tablename);
-
-		/* Dump out chain names first,
-		 * thereby preventing dependency conflicts */
-		for (chain = iptc_first_chain(h);
-		     chain;
-		     chain = iptc_next_chain(h)) {
-
-			printf(":%s ", chain);
-			if (iptc_builtin(chain, h)) {
-				struct ipt_counters count;
-				printf("%s ",
-				       iptc_get_policy(chain, &count, h));
-				printf("[%llu:%llu]\n", (unsigned long long)count.pcnt, (unsigned long long)count.bcnt);
-			} else {
-				printf("- [0:0]\n");
-			}
-		}
+	now = time(NULL);
 
+	printf("# Generated by iptables-save v%s on %s",
+	       XTABLES_VERSION, ctime(&now));
+	printf("*%s\n", tablename);
 
-		for (chain = iptc_first_chain(h);
-		     chain;
-		     chain = iptc_next_chain(h)) {
-			const struct ipt_entry *e;
+	/* Dump out chain names first,
+	 * thereby preventing dependency conflicts */
+	for (chain = iptc_first_chain(h); chain != NULL;
+	     chain = iptc_next_chain(h)) {
 
-			/* Dump out rules */
-			e = iptc_first_rule(chain, h);
-			while(e) {
-				print_rule(e, h, chain, show_counters);
-				e = iptc_next_rule(e, h);
-			}
+		printf(":%s ", chain);
+		if (iptc_builtin(chain, h)) {
+			struct ipt_counters count;
+			printf("%s ", iptc_get_policy(chain, &count, h));
+			printf("[%llu:%llu]\n", (unsigned long long)count.pcnt, (unsigned long long)count.bcnt);
+		} else {
+			printf("- [0:0]\n");
 		}
+	}
+
+	for (chain = iptc_first_chain(h); chain != NULL;
+	     chain = iptc_next_chain(h)) {
+		const struct ipt_entry *e;
 
-		now = time(NULL);
-		printf("COMMIT\n");
-		printf("# Completed on %s", ctime(&now));
+		/* Dump out rules */
+		e = iptc_first_rule(chain, h);
+		while (e) {
+			print_rule(e, h, chain, show_counters);
+			e = iptc_next_rule(e, h);
+		}
 	}
 
+	now = time(NULL);
+	printf("COMMIT\n");
+	printf("# Completed on %s", ctime(&now));
+
 	iptc_free(h);
 
 	return 1;
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux