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

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