diff options
Diffstat (limited to 'iptables/ip6tables-save.c')
-rw-r--r-- | iptables/ip6tables-save.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/iptables/ip6tables-save.c b/iptables/ip6tables-save.c index 8e3a6afd..5085982b 100644 --- a/iptables/ip6tables-save.c +++ b/iptables/ip6tables-save.c @@ -19,6 +19,9 @@ #include "ip6tables.h" #include "ip6tables-multi.h" +#define prog_name ip6tables_globals.program_name +#define prog_vers ip6tables_globals.program_version + static int show_counters; static const struct option options[] = { @@ -27,6 +30,7 @@ static const struct option options[] = { {.name = "table", .has_arg = true, .val = 't'}, {.name = "modprobe", .has_arg = true, .val = 'M'}, {.name = "file", .has_arg = true, .val = 'f'}, + {.name = "version", .has_arg = false, .val = 'V'}, {NULL}, }; @@ -146,7 +150,7 @@ int ip6tables_save_main(int argc, char *argv[]) init_extensions6(); #endif - while ((c = getopt_long(argc, argv, "bcdt:M:f:", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "bcdt:M:f:V", options, NULL)) != -1) { switch (c) { case 'b': fprintf(stderr, "-b/--binary option is not implemented\n"); @@ -180,6 +184,9 @@ int ip6tables_save_main(int argc, char *argv[]) case 'd': do_output(tablename); exit(0); + case 'V': + printf("%s v%s (legacy)\n", prog_name, prog_vers); + exit(0); default: fprintf(stderr, "Look at manual page `ip6tables-save.8' for more information.\n"); |