summaryrefslogtreecommitdiffstats
path: root/package/network/utils/iptables/patches/400-lenient-restore.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/network/utils/iptables/patches/400-lenient-restore.patch')
-rw-r--r--package/network/utils/iptables/patches/400-lenient-restore.patch70
1 files changed, 37 insertions, 33 deletions
diff --git a/package/network/utils/iptables/patches/400-lenient-restore.patch b/package/network/utils/iptables/patches/400-lenient-restore.patch
index 1bf7371b1..696d73322 100644
--- a/package/network/utils/iptables/patches/400-lenient-restore.patch
+++ b/package/network/utils/iptables/patches/400-lenient-restore.patch
@@ -1,6 +1,8 @@
---- a/ip6tables-restore.c
-+++ b/ip6tables-restore.c
-@@ -16,6 +16,8 @@
+Index: iptables-1.4.18/iptables/ip6tables-restore.c
+===================================================================
+--- iptables-1.4.18.orig/iptables/ip6tables-restore.c 2013-03-05 16:37:31.000000000 +0100
++++ iptables-1.4.18/iptables/ip6tables-restore.c 2013-03-05 16:42:57.475249794 +0100
+@@ -14,6 +14,8 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -9,7 +11,7 @@
#include "ip6tables.h"
#include "xtables.h"
#include "libiptc/libip6tc.h"
-@@ -27,6 +29,7 @@
+@@ -25,6 +27,7 @@
#define DEBUGP(x, args...)
#endif
@@ -17,15 +19,15 @@
static int binary = 0, counters = 0, verbose = 0, noflush = 0;
/* Keeping track of external matches and targets. */
-@@ -37,6 +40,7 @@ static const struct option options[] = {
+@@ -35,6 +38,7 @@
{.name = "test", .has_arg = false, .val = 't'},
{.name = "help", .has_arg = false, .val = 'h'},
{.name = "noflush", .has_arg = false, .val = 'n'},
+ {.name = "lenient", .has_arg = false, .val = 'l'},
{.name = "modprobe", .has_arg = true, .val = 'M'},
+ {.name = "table", .has_arg = true, .val = 'T'},
{NULL},
- };
-@@ -52,6 +56,7 @@ static void print_usage(const char *name
+@@ -51,6 +55,7 @@
" [ --test ]\n"
" [ --help ]\n"
" [ --noflush ]\n"
@@ -33,7 +35,7 @@
" [ --modprobe=<command>]\n", name);
exit(1);
-@@ -114,6 +119,17 @@ static void free_argv(void) {
+@@ -114,6 +119,17 @@
free(newargv[i]);
}
@@ -48,19 +50,19 @@
+ longjmp(jmp, status);
+}
+
- #ifdef IPTABLES_MULTI
- int ip6tables_restore_main(int argc, char *argv[])
- #else
-@@ -141,7 +157,7 @@ int main(int argc, char *argv[])
- init_extensions();
+ static void add_param_to_argv(char *parsestart)
+ {
+ int quote_open = 0, escaped = 0, param_len = 0;
+@@ -204,7 +220,7 @@
+ init_extensions6();
#endif
-- while ((c = getopt_long(argc, argv, "bcvthnM:", options, NULL)) != -1) {
-+ while ((c = getopt_long(argc, argv, "bcvthnlM:", options, NULL)) != -1) {
+- while ((c = getopt_long(argc, argv, "bcvthnM:T:", options, NULL)) != -1) {
++ while ((c = getopt_long(argc, argv, "bcvthnlM:T:", options, NULL)) != -1) {
switch (c) {
case 'b':
binary = 1;
-@@ -162,6 +178,9 @@ int main(int argc, char *argv[])
+@@ -225,6 +241,9 @@
case 'n':
noflush = 1;
break;
@@ -70,7 +72,7 @@
case 'M':
xtables_modprobe_program = optarg;
break;
-@@ -440,8 +459,11 @@ int main(int argc, char *argv[])
+@@ -437,8 +456,11 @@
for (a = 0; a < newargc; a++)
DEBUGP("argv[%u]: %s\n", a, newargv[a]);
@@ -84,9 +86,11 @@
free_argv();
fflush(stdout);
---- a/iptables-restore.c
-+++ b/iptables-restore.c
-@@ -13,6 +13,8 @@
+Index: iptables-1.4.18/iptables/iptables-restore.c
+===================================================================
+--- iptables-1.4.18.orig/iptables/iptables-restore.c 2013-03-05 16:37:31.000000000 +0100
++++ iptables-1.4.18/iptables/iptables-restore.c 2013-03-05 16:44:56.303247355 +0100
+@@ -11,6 +11,8 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -95,7 +99,7 @@
#include "iptables.h"
#include "xtables.h"
#include "libiptc/libiptc.h"
-@@ -24,6 +26,7 @@
+@@ -22,6 +24,7 @@
#define DEBUGP(x, args...)
#endif
@@ -103,7 +107,7 @@
static int binary = 0, counters = 0, verbose = 0, noflush = 0;
/* Keeping track of external matches and targets. */
-@@ -34,6 +37,7 @@ static const struct option options[] = {
+@@ -32,6 +35,7 @@
{.name = "test", .has_arg = false, .val = 't'},
{.name = "help", .has_arg = false, .val = 'h'},
{.name = "noflush", .has_arg = false, .val = 'n'},
@@ -111,7 +115,7 @@
{.name = "modprobe", .has_arg = true, .val = 'M'},
{.name = "table", .has_arg = true, .val = 'T'},
{NULL},
-@@ -52,6 +56,7 @@ static void print_usage(const char *name
+@@ -50,6 +54,7 @@
" [ --test ]\n"
" [ --help ]\n"
" [ --noflush ]\n"
@@ -119,7 +123,7 @@
" [ --table=<TABLE> ]\n"
" [ --modprobe=<command>]\n", name);
-@@ -114,6 +119,17 @@ static void free_argv(void) {
+@@ -113,6 +118,17 @@
free(newargv[i]);
}
@@ -134,11 +138,11 @@
+ longjmp(jmp, status);
+}
+
- #ifdef IPTABLES_MULTI
- int
- iptables_restore_main(int argc, char *argv[])
-@@ -144,7 +160,7 @@ main(int argc, char *argv[])
- init_extensions();
+ static void add_param_to_argv(char *parsestart)
+ {
+ int quote_open = 0, escaped = 0, param_len = 0;
+@@ -204,7 +220,7 @@
+ init_extensions4();
#endif
- while ((c = getopt_long(argc, argv, "bcvthnM:T:", options, NULL)) != -1) {
@@ -146,7 +150,7 @@
switch (c) {
case 'b':
binary = 1;
-@@ -165,6 +181,9 @@ main(int argc, char *argv[])
+@@ -225,6 +241,9 @@
case 'n':
noflush = 1;
break;
@@ -156,14 +160,14 @@
case 'M':
xtables_modprobe_program = optarg;
break;
-@@ -445,8 +464,11 @@ main(int argc, char *argv[])
+@@ -437,8 +456,11 @@
for (a = 0; a < newargc; a++)
DEBUGP("argv[%u]: %s\n", a, newargv[a]);
-- ret = do_command(newargc, newargv,
+- ret = do_command4(newargc, newargv,
- &newargv[2], &handle);
+ if (!setjmp(jmp))
-+ ret = do_command(newargc, newargv,
++ ret = do_command4(newargc, newargv,
+ &newargv[2], &handle);
+ else
+ ret = 1;