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

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