iptables: fix issues with the new musl version

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 39964
This commit is contained in:
Felix Fietkau 2014-03-20 13:51:40 +00:00
parent 7fa3fe6741
commit 0ccec8179d
3 changed files with 22 additions and 40 deletions

View File

@ -1,8 +1,6 @@
Index: iptables-1.4.19.1/extensions/GNUmakefile.in
===================================================================
--- iptables-1.4.19.1.orig/extensions/GNUmakefile.in 2013-05-29 16:37:41.304675049 +0200
+++ iptables-1.4.19.1/extensions/GNUmakefile.in 2013-05-29 16:37:41.296675048 +0200
@@ -45,9 +45,24 @@
--- a/extensions/GNUmakefile.in
+++ b/extensions/GNUmakefile.in
@@ -45,9 +45,24 @@ pfx_symlinks := NOTRACK state
pfx_build_mod := $(filter-out @blacklist_modules@,${pfx_build_mod})
pf4_build_mod := $(filter-out @blacklist_modules@,${pf4_build_mod})
pf6_build_mod := $(filter-out @blacklist_modules@,${pf6_build_mod})
@ -30,7 +28,7 @@ Index: iptables-1.4.19.1/extensions/GNUmakefile.in
pfx_solibs := $(patsubst %,libxt_%.so,${pfx_build_mod} ${pfx_symlinks})
pf4_solibs := $(patsubst %,libipt_%.so,${pf4_build_mod})
pf6_solibs := $(patsubst %,libip6t_%.so,${pf6_build_mod})
@@ -58,11 +73,11 @@
@@ -58,11 +73,11 @@ pf6_solibs := $(patsubst %,libip6t_%.
#
targets := libext.a libext4.a libext6.a matches.man targets.man
targets_install :=
@ -47,7 +45,7 @@ Index: iptables-1.4.19.1/extensions/GNUmakefile.in
.SECONDARY:
@@ -123,9 +138,9 @@
@@ -126,9 +141,9 @@ libext4.a: initext4.o ${libext4_objs}
libext6.a: initext6.o ${libext6_objs}
${AM_VERBOSE_AR} ${AR} crs $@ $^;

View File

@ -1,6 +1,6 @@
--- a/extensions/libip6t_ipv6header.c
+++ b/extensions/libip6t_ipv6header.c
@@ -10,6 +10,9 @@ on whether they contain certain headers
@@ -10,6 +10,9 @@ on whether they contain certain headers
#include <netdb.h>
#include <xtables.h>
#include <linux/netfilter_ipv6/ip6t_ipv6header.h>
@ -60,18 +60,6 @@
-#include <linux/in6.h>
-#endif
#endif
--- a/include/linux/netfilter/xt_osf.h
+++ b/include/linux/netfilter/xt_osf.h
@@ -21,6 +21,9 @@
#define _XT_OSF_H
#include <linux/types.h>
+#if !defined(__UCLIBC__) && !defined(__GLIBC__)
+#include <linux/tcp.h>
+#endif
#define MAXGENRELEN 32
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -16,6 +16,7 @@

View File

@ -1,7 +1,5 @@
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
--- a/iptables/ip6tables-restore.c
+++ b/iptables/ip6tables-restore.c
@@ -14,6 +14,8 @@
#include <string.h>
#include <stdio.h>
@ -19,7 +17,7 @@ Index: iptables-1.4.18/iptables/ip6tables-restore.c
static int binary = 0, counters = 0, verbose = 0, noflush = 0;
/* Keeping track of external matches and targets. */
@@ -35,6 +38,7 @@
@@ -35,6 +38,7 @@ static const struct option options[] = {
{.name = "test", .has_arg = false, .val = 't'},
{.name = "help", .has_arg = false, .val = 'h'},
{.name = "noflush", .has_arg = false, .val = 'n'},
@ -27,7 +25,7 @@ Index: iptables-1.4.18/iptables/ip6tables-restore.c
{.name = "modprobe", .has_arg = true, .val = 'M'},
{.name = "table", .has_arg = true, .val = 'T'},
{NULL},
@@ -51,6 +55,7 @@
@@ -51,6 +55,7 @@ static void print_usage(const char *name
" [ --test ]\n"
" [ --help ]\n"
" [ --noflush ]\n"
@ -35,7 +33,7 @@ Index: iptables-1.4.18/iptables/ip6tables-restore.c
" [ --modprobe=<command>]\n", name);
exit(1);
@@ -114,6 +119,17 @@
@@ -114,6 +119,17 @@ static void free_argv(void) {
free(newargv[i]);
}
@ -53,7 +51,7 @@ Index: iptables-1.4.18/iptables/ip6tables-restore.c
static void add_param_to_argv(char *parsestart)
{
int quote_open = 0, escaped = 0, param_len = 0;
@@ -204,7 +220,7 @@
@@ -204,7 +220,7 @@ int ip6tables_restore_main(int argc, cha
init_extensions6();
#endif
@ -62,7 +60,7 @@ Index: iptables-1.4.18/iptables/ip6tables-restore.c
switch (c) {
case 'b':
binary = 1;
@@ -225,6 +241,9 @@
@@ -225,6 +241,9 @@ int ip6tables_restore_main(int argc, cha
case 'n':
noflush = 1;
break;
@ -72,7 +70,7 @@ Index: iptables-1.4.18/iptables/ip6tables-restore.c
case 'M':
xtables_modprobe_program = optarg;
break;
@@ -437,8 +456,11 @@
@@ -437,8 +456,11 @@ int ip6tables_restore_main(int argc, cha
for (a = 0; a < newargc; a++)
DEBUGP("argv[%u]: %s\n", a, newargv[a]);
@ -86,10 +84,8 @@ Index: iptables-1.4.18/iptables/ip6tables-restore.c
free_argv();
fflush(stdout);
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
--- a/iptables/iptables-restore.c
+++ b/iptables/iptables-restore.c
@@ -11,6 +11,8 @@
#include <string.h>
#include <stdio.h>
@ -107,7 +103,7 @@ Index: iptables-1.4.18/iptables/iptables-restore.c
static int binary = 0, counters = 0, verbose = 0, noflush = 0;
/* Keeping track of external matches and targets. */
@@ -32,6 +35,7 @@
@@ -32,6 +35,7 @@ static const struct option options[] = {
{.name = "test", .has_arg = false, .val = 't'},
{.name = "help", .has_arg = false, .val = 'h'},
{.name = "noflush", .has_arg = false, .val = 'n'},
@ -115,7 +111,7 @@ Index: iptables-1.4.18/iptables/iptables-restore.c
{.name = "modprobe", .has_arg = true, .val = 'M'},
{.name = "table", .has_arg = true, .val = 'T'},
{NULL},
@@ -50,6 +54,7 @@
@@ -50,6 +54,7 @@ static void print_usage(const char *name
" [ --test ]\n"
" [ --help ]\n"
" [ --noflush ]\n"
@ -123,7 +119,7 @@ Index: iptables-1.4.18/iptables/iptables-restore.c
" [ --table=<TABLE> ]\n"
" [ --modprobe=<command>]\n", name);
@@ -113,6 +118,17 @@
@@ -113,6 +118,17 @@ static void free_argv(void) {
free(newargv[i]);
}
@ -141,7 +137,7 @@ Index: iptables-1.4.18/iptables/iptables-restore.c
static void add_param_to_argv(char *parsestart)
{
int quote_open = 0, escaped = 0, param_len = 0;
@@ -204,7 +220,7 @@
@@ -204,7 +220,7 @@ iptables_restore_main(int argc, char *ar
init_extensions4();
#endif
@ -150,7 +146,7 @@ Index: iptables-1.4.18/iptables/iptables-restore.c
switch (c) {
case 'b':
binary = 1;
@@ -225,6 +241,9 @@
@@ -225,6 +241,9 @@ iptables_restore_main(int argc, char *ar
case 'n':
noflush = 1;
break;
@ -160,7 +156,7 @@ Index: iptables-1.4.18/iptables/iptables-restore.c
case 'M':
xtables_modprobe_program = optarg;
break;
@@ -437,8 +456,11 @@
@@ -437,8 +456,11 @@ iptables_restore_main(int argc, char *ar
for (a = 0; a < newargc; a++)
DEBUGP("argv[%u]: %s\n", a, newargv[a]);