|
|
fc8f74 |
From ea9d40744307d7c49808d8fabfc904d525081055 Mon Sep 17 00:00:00 2001
|
|
|
fc8f74 |
From: Phil Sutter <phil@nwl.cc>
|
|
|
fc8f74 |
Date: Fri, 21 Feb 2020 13:29:05 +0100
|
|
|
fc8f74 |
Subject: [PATCH] xtables: Drop -4 and -6 support from xtables-{save,restore}
|
|
|
fc8f74 |
|
|
|
fc8f74 |
Legacy tools don't support those options, either.
|
|
|
fc8f74 |
|
|
|
fc8f74 |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
fc8f74 |
(cherry picked from commit 0f40a8bc49d3f7b815336199931a82f919f37c4e)
|
|
|
fc8f74 |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
fc8f74 |
---
|
|
|
fc8f74 |
iptables/xtables-restore.c | 9 +--------
|
|
|
fc8f74 |
iptables/xtables-save.c | 11 +----------
|
|
|
fc8f74 |
2 files changed, 2 insertions(+), 18 deletions(-)
|
|
|
fc8f74 |
|
|
|
fc8f74 |
diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c
|
|
|
fc8f74 |
index 11834c0ea98c5..c472ac9bf651b 100644
|
|
|
fc8f74 |
--- a/iptables/xtables-restore.c
|
|
|
fc8f74 |
+++ b/iptables/xtables-restore.c
|
|
|
fc8f74 |
@@ -379,7 +379,7 @@ xtables_restore_main(int family, const char *progname, int argc, char *argv[])
|
|
|
fc8f74 |
exit(1);
|
|
|
fc8f74 |
}
|
|
|
fc8f74 |
|
|
|
fc8f74 |
- while ((c = getopt_long(argc, argv, "bcvVthnM:T:46wW", options, NULL)) != -1) {
|
|
|
fc8f74 |
+ while ((c = getopt_long(argc, argv, "bcvVthnM:T:wW", options, NULL)) != -1) {
|
|
|
fc8f74 |
switch (c) {
|
|
|
fc8f74 |
case 'b':
|
|
|
fc8f74 |
fprintf(stderr, "-b/--binary option is not implemented\n");
|
|
|
fc8f74 |
@@ -408,13 +408,6 @@ xtables_restore_main(int family, const char *progname, int argc, char *argv[])
|
|
|
fc8f74 |
case 'T':
|
|
|
fc8f74 |
p.tablename = optarg;
|
|
|
fc8f74 |
break;
|
|
|
fc8f74 |
- case '4':
|
|
|
fc8f74 |
- h.family = AF_INET;
|
|
|
fc8f74 |
- break;
|
|
|
fc8f74 |
- case '6':
|
|
|
fc8f74 |
- h.family = AF_INET6;
|
|
|
fc8f74 |
- xtables_set_nfproto(AF_INET6);
|
|
|
fc8f74 |
- break;
|
|
|
fc8f74 |
case 'w': /* fallthrough. Ignored by xt-restore */
|
|
|
fc8f74 |
case 'W':
|
|
|
fc8f74 |
if (!optarg && xs_has_arg(argc, argv))
|
|
|
fc8f74 |
diff --git a/iptables/xtables-save.c b/iptables/xtables-save.c
|
|
|
fc8f74 |
index 228282deaed07..28f7490275ce5 100644
|
|
|
fc8f74 |
--- a/iptables/xtables-save.c
|
|
|
fc8f74 |
+++ b/iptables/xtables-save.c
|
|
|
fc8f74 |
@@ -32,7 +32,7 @@
|
|
|
fc8f74 |
#define prog_name xtables_globals.program_name
|
|
|
fc8f74 |
#define prog_vers xtables_globals.program_version
|
|
|
fc8f74 |
|
|
|
fc8f74 |
-static const char *ipt_save_optstring = "bcdt:M:f:46V";
|
|
|
fc8f74 |
+static const char *ipt_save_optstring = "bcdt:M:f:V";
|
|
|
fc8f74 |
static const struct option ipt_save_options[] = {
|
|
|
fc8f74 |
{.name = "counters", .has_arg = false, .val = 'c'},
|
|
|
fc8f74 |
{.name = "version", .has_arg = false, .val = 'V'},
|
|
|
fc8f74 |
@@ -40,8 +40,6 @@ static const struct option ipt_save_options[] = {
|
|
|
fc8f74 |
{.name = "table", .has_arg = true, .val = 't'},
|
|
|
fc8f74 |
{.name = "modprobe", .has_arg = true, .val = 'M'},
|
|
|
fc8f74 |
{.name = "file", .has_arg = true, .val = 'f'},
|
|
|
fc8f74 |
- {.name = "ipv4", .has_arg = false, .val = '4'},
|
|
|
fc8f74 |
- {.name = "ipv6", .has_arg = false, .val = '6'},
|
|
|
fc8f74 |
{NULL},
|
|
|
fc8f74 |
};
|
|
|
fc8f74 |
|
|
|
fc8f74 |
@@ -187,13 +185,6 @@ xtables_save_main(int family, int argc, char *argv[],
|
|
|
fc8f74 |
case 'd':
|
|
|
fc8f74 |
dump = true;
|
|
|
fc8f74 |
break;
|
|
|
fc8f74 |
- case '4':
|
|
|
fc8f74 |
- h.family = AF_INET;
|
|
|
fc8f74 |
- break;
|
|
|
fc8f74 |
- case '6':
|
|
|
fc8f74 |
- h.family = AF_INET6;
|
|
|
fc8f74 |
- xtables_set_nfproto(AF_INET6);
|
|
|
fc8f74 |
- break;
|
|
|
fc8f74 |
case 'V':
|
|
|
fc8f74 |
printf("%s v%s (nf_tables)\n", prog_name, prog_vers);
|
|
|
fc8f74 |
exit(0);
|
|
|
fc8f74 |
--
|
|
|
fc8f74 |
2.26.2
|
|
|
fc8f74 |
|