Blame SOURCES/0020-xtables-Drop-4-and-6-support-from-xtables-save-resto.patch

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