- add upstream --noflush option patch for ebtables-restore
This commit is contained in:
parent
01fc459b0e
commit
8e67d1c9a6
69
ebtables-2.0.10-noflush.patch
Normal file
69
ebtables-2.0.10-noflush.patch
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
commit 3a25ae2361da048f24524d8e63d70f4cd40444f3
|
||||||
|
Author: Sanket Shah <sanket.shah@cyberoam.com>
|
||||||
|
Date: Wed Jul 31 21:40:08 2013 +0200
|
||||||
|
|
||||||
|
Add --noflush command line support for ebtables-restore
|
||||||
|
|
||||||
|
diff --git a/ebtables-restore.c b/ebtables-restore.c
|
||||||
|
index ea02960..bb4d0cf 100644
|
||||||
|
--- a/ebtables-restore.c
|
||||||
|
+++ b/ebtables-restore.c
|
||||||
|
@@ -22,13 +22,25 @@
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
+#include <getopt.h>
|
||||||
|
#include "include/ebtables_u.h"
|
||||||
|
|
||||||
|
+static const struct option options[] = {
|
||||||
|
+ {.name = "noflush", .has_arg = 0, .val = 'n'},
|
||||||
|
+ { 0 }
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
static struct ebt_u_replace replace[3];
|
||||||
|
void ebt_early_init_once();
|
||||||
|
|
||||||
|
#define OPT_KERNELDATA 0x800 /* Also defined in ebtables.c */
|
||||||
|
|
||||||
|
+static void print_usage()
|
||||||
|
+{
|
||||||
|
+ fprintf(stderr, "Usage: ebtables-restore [ --noflush ]\n");
|
||||||
|
+ exit(1);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void copy_table_names()
|
||||||
|
{
|
||||||
|
strcpy(replace[0].name, "filter");
|
||||||
|
@@ -41,11 +53,20 @@ static void copy_table_names()
|
||||||
|
int main(int argc_, char *argv_[])
|
||||||
|
{
|
||||||
|
char *argv[EBTD_ARGC_MAX], cmdline[EBTD_CMDLINE_MAXLN];
|
||||||
|
- int i, offset, quotemode = 0, argc, table_nr = -1, line = 0, whitespace;
|
||||||
|
+ int i, offset, quotemode = 0, argc, table_nr = -1, line = 0, whitespace, c, flush = 1;
|
||||||
|
char ebtables_str[] = "ebtables";
|
||||||
|
|
||||||
|
- if (argc_ != 1)
|
||||||
|
- ebtrest_print_error("options are not supported");
|
||||||
|
+ while ((c = getopt_long(argc_, argv_, "n", options, NULL)) != -1) {
|
||||||
|
+ switch(c) {
|
||||||
|
+ case 'n':
|
||||||
|
+ flush = 0;
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ print_usage();
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
ebt_silent = 0;
|
||||||
|
copy_table_names();
|
||||||
|
ebt_early_init_once();
|
||||||
|
@@ -68,7 +89,7 @@ int main(int argc_, char *argv_[])
|
||||||
|
ebtrest_print_error("table '%s' was not recognized", cmdline+1);
|
||||||
|
table_nr = i;
|
||||||
|
replace[table_nr].command = 11;
|
||||||
|
- ebt_get_kernel_table(&replace[table_nr], 1);
|
||||||
|
+ ebt_get_kernel_table(&replace[table_nr], flush);
|
||||||
|
replace[table_nr].command = 0;
|
||||||
|
replace[table_nr].flags = OPT_KERNELDATA; /* Prevent do_command from initialising replace */
|
||||||
|
continue;
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: ebtables
|
Name: ebtables
|
||||||
Version: 2.0.10
|
Version: 2.0.10
|
||||||
Release: 19%{?dist}
|
Release: 20%{?dist}
|
||||||
Summary: Ethernet Bridge frame table administration tool
|
Summary: Ethernet Bridge frame table administration tool
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
@ -19,6 +19,7 @@ Patch5: ebtables-2.0.0-audit.patch
|
|||||||
Patch6: 0001-add-RARP-and-update-iana-url.patch
|
Patch6: 0001-add-RARP-and-update-iana-url.patch
|
||||||
# Move lockfile to /run/ebtables.lock
|
# Move lockfile to /run/ebtables.lock
|
||||||
Patch7: ebtables-2.0.10-lockdirfix.patch
|
Patch7: ebtables-2.0.10-lockdirfix.patch
|
||||||
|
Patch8: ebtables-2.0.10-noflush.patch
|
||||||
BuildRequires: systemd-units
|
BuildRequires: systemd-units
|
||||||
Requires(post): systemd
|
Requires(post): systemd
|
||||||
Requires(preun): systemd
|
Requires(preun): systemd
|
||||||
@ -44,6 +45,7 @@ like iptables. There are no known incompatibility issues.
|
|||||||
%patch5 -p1 -b .AUDIT
|
%patch5 -p1 -b .AUDIT
|
||||||
%patch6 -p1 -b .RARP
|
%patch6 -p1 -b .RARP
|
||||||
%patch7 -p1 -b .lockdirfix
|
%patch7 -p1 -b .lockdirfix
|
||||||
|
%patch8 -p1 -b .noflush
|
||||||
|
|
||||||
# Convert to UTF-8
|
# Convert to UTF-8
|
||||||
f=THANKS; iconv -f iso-8859-1 -t utf-8 $f -o $f.utf8 ; mv $f.utf8 $f
|
f=THANKS; iconv -f iso-8859-1 -t utf-8 $f -o $f.utf8 ; mv $f.utf8 $f
|
||||||
@ -100,6 +102,9 @@ mv %{buildroot}/%{_lib}/ebtables/libebtc.so %{buildroot}/%{_lib}/
|
|||||||
%ghost %{_sysconfdir}/sysconfig/ebtables.broute
|
%ghost %{_sysconfdir}/sysconfig/ebtables.broute
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon May 9 2016 Thomas Woerner <twoerner@redhat.com> - 2.0.10-20
|
||||||
|
- add upstream --noflush option patch for ebtables-restore
|
||||||
|
|
||||||
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-19
|
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-19
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user