]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables: Drop -4 and -6 support from xtables-{save,restore}
authorPhil Sutter <phil@nwl.cc>
Fri, 21 Feb 2020 12:29:05 +0000 (13:29 +0100)
committerPhil Sutter <phil@nwl.cc>
Mon, 24 Feb 2020 11:04:27 +0000 (12:04 +0100)
Legacy tools don't support those options, either.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/xtables-restore.c
iptables/xtables-save.c

index fb2ac8b5c12a3c16a307693acde8fc55fb7a4d1b..61a3c920016151d6d339c02eab14fb84d91112c8 100644 (file)
@@ -381,7 +381,7 @@ xtables_restore_main(int family, const char *progname, int argc, char *argv[])
                exit(1);
        }
 
-       while ((c = getopt_long(argc, argv, "bcvVthnM:T:46wW", options, NULL)) != -1) {
+       while ((c = getopt_long(argc, argv, "bcvVthnM:T:wW", options, NULL)) != -1) {
                switch (c) {
                        case 'b':
                                fprintf(stderr, "-b/--binary option is not implemented\n");
@@ -410,13 +410,6 @@ xtables_restore_main(int family, const char *progname, int argc, char *argv[])
                        case 'T':
                                p.tablename = optarg;
                                break;
-                       case '4':
-                               h.family = AF_INET;
-                               break;
-                       case '6':
-                               h.family = AF_INET6;
-                               xtables_set_nfproto(AF_INET6);
-                               break;
                        case 'w': /* fallthrough.  Ignored by xt-restore */
                        case 'W':
                                if (!optarg && xs_has_arg(argc, argv))
index 3a52f8c3d820991383e905ee90855f07c0c5cd62..1b6c363bef7c1d0b74b2f77ecee849745cddbbfa 100644 (file)
@@ -32,7 +32,7 @@
 #define prog_name xtables_globals.program_name
 #define prog_vers xtables_globals.program_version
 
-static const char *ipt_save_optstring = "bcdt:M:f:46V";
+static const char *ipt_save_optstring = "bcdt:M:f:V";
 static const struct option ipt_save_options[] = {
        {.name = "counters", .has_arg = false, .val = 'c'},
        {.name = "version",  .has_arg = false, .val = 'V'},
@@ -40,8 +40,6 @@ static const struct option ipt_save_options[] = {
        {.name = "table",    .has_arg = true,  .val = 't'},
        {.name = "modprobe", .has_arg = true,  .val = 'M'},
        {.name = "file",     .has_arg = true,  .val = 'f'},
-       {.name = "ipv4",     .has_arg = false, .val = '4'},
-       {.name = "ipv6",     .has_arg = false, .val = '6'},
        {NULL},
 };
 
@@ -189,13 +187,6 @@ xtables_save_main(int family, int argc, char *argv[],
                case 'd':
                        dump = true;
                        break;
-               case '4':
-                       h.family = AF_INET;
-                       break;
-               case '6':
-                       h.family = AF_INET6;
-                       xtables_set_nfproto(AF_INET6);
-                       break;
                case 'V':
                        printf("%s v%s (nf_tables)\n", prog_name, prog_vers);
                        exit(0);