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