From 5fa68e820a641039e48045a82560ed13471ecff4 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 27 Aug 2011 09:21:46 +0200 Subject: doc: fix undesired newline in ip6tables-restore(8) Signed-off-by: Jan Engelhardt --- iptables/ip6tables-restore.8 | 1 - 1 file changed, 1 deletion(-) (limited to 'iptables') diff --git a/iptables/ip6tables-restore.8 b/iptables/ip6tables-restore.8 index 02648070..aa09768f 100644 --- a/iptables/ip6tables-restore.8 +++ b/iptables/ip6tables-restore.8 @@ -32,7 +32,6 @@ I/O redirection provided by your shell to read from a file restore the values of all packet and byte counters .TP \fB\-n\fR, \fB\-\-noflush\fR -.TP don't flush the previous contents of the table. If not specified, .B ip6tables-restore flushes (deletes) all previous contents of the respective IPv6 Table. -- cgit v1.2.3 From b171b546cb529e2996df05fe91cba058fae9fd99 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 27 Aug 2011 09:29:30 +0200 Subject: ip6tables-restore: implement missing -T option Commit v1.4.0-rc1-12-ge8665f8 forgot to port the change to the ip6tables part. Signed-off-by: Jan Engelhardt --- iptables/ip6tables-restore.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'iptables') diff --git a/iptables/ip6tables-restore.c b/iptables/ip6tables-restore.c index 985744d6..1487504b 100644 --- a/iptables/ip6tables-restore.c +++ b/iptables/ip6tables-restore.c @@ -36,6 +36,7 @@ static const struct option options[] = { {.name = "help", .has_arg = false, .val = 'h'}, {.name = "noflush", .has_arg = false, .val = 'n'}, {.name = "modprobe", .has_arg = true, .val = 'M'}, + {.name = "table", .has_arg = true, .val = 'T'}, {NULL}, }; @@ -121,6 +122,7 @@ int ip6tables_restore_main(int argc, char *argv[]) char curtable[IP6T_TABLE_MAXNAMELEN + 1]; FILE *in; int in_table = 0, testing = 0; + const char *tablename = NULL; line = 0; @@ -137,7 +139,7 @@ int ip6tables_restore_main(int argc, char *argv[]) init_extensions6(); #endif - while ((c = getopt_long(argc, argv, "bcvthnM:", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "bcvthnM:T:", options, NULL)) != -1) { switch (c) { case 'b': binary = 1; @@ -161,6 +163,9 @@ int ip6tables_restore_main(int argc, char *argv[]) case 'M': xtables_modprobe_program = optarg; break; + case 'T': + tablename = optarg; + break; } } @@ -216,6 +221,8 @@ int ip6tables_restore_main(int argc, char *argv[]) strncpy(curtable, table, IP6T_TABLE_MAXNAMELEN); curtable[IP6T_TABLE_MAXNAMELEN] = '\0'; + if (tablename != NULL && strcmp(tablename, table) != 0) + continue; if (handle) ip6tc_free(handle); @@ -442,6 +449,8 @@ int ip6tables_restore_main(int argc, char *argv[]) free_argv(); fflush(stdout); } + if (tablename != NULL && strcmp(tablename, curtable) != 0) + continue; if (!ret) { fprintf(stderr, "%s: line %u failed\n", ip6tables_globals.program_name, -- cgit v1.2.3 From 1e4965232d77ab752c9c781afcf854f4b173c7b1 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 27 Aug 2011 09:31:35 +0200 Subject: doc: document iptables-restore's -T option Commit v1.4.0-rc1-12-ge8665f8 completely forgot this. Signed-off-by: Jan Engelhardt --- iptables/ip6tables-restore.8 | 3 +++ iptables/iptables-restore.8 | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'iptables') diff --git a/iptables/ip6tables-restore.8 b/iptables/ip6tables-restore.8 index aa09768f..59a3b2e5 100644 --- a/iptables/ip6tables-restore.8 +++ b/iptables/ip6tables-restore.8 @@ -33,6 +33,9 @@ restore the values of all packet and byte counters .TP \fB\-n\fR, \fB\-\-noflush\fR don't flush the previous contents of the table. If not specified, +.TP +\fB\-T\fP, \fB\-\-table\fP \fIname\fP +Restore only the named table even if the input stream contains other ones. .B ip6tables-restore flushes (deletes) all previous contents of the respective IPv6 Table. .SH BUGS diff --git a/iptables/iptables-restore.8 b/iptables/iptables-restore.8 index a52bcebe..0dd20cb1 100644 --- a/iptables/iptables-restore.8 +++ b/iptables/iptables-restore.8 @@ -21,7 +21,7 @@ .SH NAME iptables-restore \(em Restore IP Tables .SH SYNOPSIS -\fBiptables\-restore\fP [\fB\-c\fP] [\fB\-n\fP] +\fBiptables\-restore\fP [\fB\-c\fP] [\fB\-n\fP] [\fB\-T\fP \fIname\fP] .SH DESCRIPTION .PP .B iptables-restore @@ -35,6 +35,9 @@ restore the values of all packet and byte counters don't flush the previous contents of the table. If not specified, .B iptables-restore flushes (deletes) all previous contents of the respective IP Table. +.TP +\fB\-T\fP, \fB\-\-table\fP \fIname\fP +Restore only the named table even if the input stream contains other ones. .SH BUGS None known as of iptables-1.2.1 release .SH AUTHOR -- cgit v1.2.3