Blame SOURCES/0022-ebtables-Dump-atomic-waste.patch

ff4a6b
From cb68daac1f24c94a48450a683a5f765dc00da164 Mon Sep 17 00:00:00 2001
ff4a6b
From: Phil Sutter <phil@nwl.cc>
ff4a6b
Date: Fri, 30 Jul 2021 12:25:10 +0200
ff4a6b
Subject: [PATCH] ebtables: Dump atomic waste
ff4a6b
ff4a6b
With ebtables-nft.8 now educating people about the missing
ff4a6b
functionality, get rid of atomic remains in source code. This eliminates
ff4a6b
mostly comments except for --atomic-commit which was treated as alias of
ff4a6b
--init-table. People not using the latter are probably trying to
ff4a6b
atomic-commit from an atomic-file which in turn is not supported, so no
ff4a6b
point keeping it.
ff4a6b
ff4a6b
Signed-off-by: Phil Sutter <phil@nwl.cc>
ff4a6b
(cherry picked from commit 263186372dc4ae6a54a29bea644bcf1fc8dc3fc0)
ff4a6b
---
ff4a6b
 iptables/xtables-eb.c | 53 -------------------------------------------
ff4a6b
 1 file changed, 53 deletions(-)
ff4a6b
ff4a6b
diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c
ff4a6b
index 5bb34d6d292a9..aeb4d92166431 100644
ff4a6b
--- a/iptables/xtables-eb.c
ff4a6b
+++ b/iptables/xtables-eb.c
ff4a6b
@@ -211,10 +211,6 @@ struct option ebt_original_options[] =
ff4a6b
 	{ "new-chain"      , required_argument, 0, 'N' },
ff4a6b
 	{ "rename-chain"   , required_argument, 0, 'E' },
ff4a6b
 	{ "delete-chain"   , optional_argument, 0, 'X' },
ff4a6b
-	{ "atomic-init"    , no_argument      , 0, 7   },
ff4a6b
-	{ "atomic-commit"  , no_argument      , 0, 8   },
ff4a6b
-	{ "atomic-file"    , required_argument, 0, 9   },
ff4a6b
-	{ "atomic-save"    , no_argument      , 0, 10  },
ff4a6b
 	{ "init-table"     , no_argument      , 0, 11  },
ff4a6b
 	{ "concurrent"     , no_argument      , 0, 13  },
ff4a6b
 	{ 0 }
ff4a6b
@@ -320,10 +316,6 @@ static void print_help(const struct xtables_target *t,
ff4a6b
 "--new-chain -N chain          : create a user defined chain\n"
ff4a6b
 "--rename-chain -E old new     : rename a chain\n"
ff4a6b
 "--delete-chain -X [chain]     : delete a user defined chain\n"
ff4a6b
-"--atomic-commit               : update the kernel w/t table contained in <FILE>\n"
ff4a6b
-"--atomic-init                 : put the initial kernel table into <FILE>\n"
ff4a6b
-"--atomic-save                 : put the current kernel table into <FILE>\n"
ff4a6b
-"--atomic-file file            : set <FILE> to file\n\n"
ff4a6b
 "Options:\n"
ff4a6b
 "--proto  -p [!] proto         : protocol hexadecimal, by name or LENGTH\n"
ff4a6b
 "--src    -s [!] address[/mask]: source mac address\n"
ff4a6b
@@ -1088,54 +1080,9 @@ print_zero:
ff4a6b
 					       "Use --Lmac2 with -L");
ff4a6b
 			flags |= LIST_MAC2;
ff4a6b
 			break;
ff4a6b
-		case 8 : /* atomic-commit */
ff4a6b
-/*
ff4a6b
-			replace->command = c;
ff4a6b
-			if (OPT_COMMANDS)
ff4a6b
-				ebt_print_error2("Multiple commands are not allowed");
ff4a6b
-			replace->flags |= OPT_COMMAND;
ff4a6b
-			if (!replace->filename)
ff4a6b
-				ebt_print_error2("No atomic file specified");*/
ff4a6b
-			/* Get the information from the file */
ff4a6b
-			/*ebt_get_table(replace, 0);*/
ff4a6b
-			/* We don't want the kernel giving us its counters,
ff4a6b
-			 * they would overwrite the counters extracted from
ff4a6b
-			 * the file */
ff4a6b
-			/*replace->num_counters = 0;*/
ff4a6b
-			/* Make sure the table will be written to the kernel */
ff4a6b
-			/*free(replace->filename);
ff4a6b
-			replace->filename = NULL;
ff4a6b
-			break;*/
ff4a6b
-		/*case 7 :*/ /* atomic-init */
ff4a6b
-		/*case 10:*/ /* atomic-save */
ff4a6b
 		case 11: /* init-table */
ff4a6b
 			nft_cmd_table_flush(h, *table, false);
ff4a6b
 			return 1;
ff4a6b
-		/*
ff4a6b
-			replace->command = c;
ff4a6b
-			if (OPT_COMMANDS)
ff4a6b
-				ebt_print_error2("Multiple commands are not allowed");
ff4a6b
-			if (c != 11 && !replace->filename)
ff4a6b
-				ebt_print_error2("No atomic file specified");
ff4a6b
-			replace->flags |= OPT_COMMAND;
ff4a6b
-			{
ff4a6b
-				char *tmp = replace->filename;*/
ff4a6b
-
ff4a6b
-				/* Get the kernel table */
ff4a6b
-				/*replace->filename = NULL;
ff4a6b
-				ebt_get_kernel_table(replace, c == 10 ? 0 : 1);
ff4a6b
-				replace->filename = tmp;
ff4a6b
-			}
ff4a6b
-			break;
ff4a6b
-		case 9 :*/ /* atomic */
ff4a6b
-			/*
ff4a6b
-			if (OPT_COMMANDS)
ff4a6b
-				ebt_print_error2("--atomic has to come before the command");*/
ff4a6b
-			/* A possible memory leak here, but this is not
ff4a6b
-			 * executed in daemon mode */
ff4a6b
-			/*replace->filename = (char *)malloc(strlen(optarg) + 1);
ff4a6b
-			strcpy(replace->filename, optarg);
ff4a6b
-			break; */
ff4a6b
 		case 13 :
ff4a6b
 			break;
ff4a6b
 		case 1 :
ff4a6b
-- 
ff4a6b
2.33.0
ff4a6b