aboutsummaryrefslogtreecommitdiff
path: root/package/iptables/iptables-optional-ipv6.patch
blob: dbff0036db0cce0c27f8df1fb53fb262ee8cb1bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Make ipv6 support optional. Patch by Steffen Schulz <sf@cbg.dyndns.org>

Submitted upstream as http://bugzilla.netfilter.org/show_bug.cgi?id=588
---
 Makefile.am  |   16 +++++++++++++---
 configure.ac |    4 ++++
 xtables.c    |    3 +++
 3 files changed, 20 insertions(+), 3 deletions(-)

Index: iptables-1.4.2/configure.ac
===================================================================
--- iptables-1.4.2.orig/configure.ac
+++ iptables-1.4.2/configure.ac
@@ -37,6 +37,9 @@
 	[enable_devel="$enableval"], [enable_devel="yes"])
 AC_ARG_ENABLE([libipq],
 	AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
+AC_ARG_ENABLE([ipv6],
+    AS_HELP_STRING([--enable-ipv6], [Build and install ip6tables]),
+    [enable_ipv6="$enableval"], [enable_ipv6="yes"])
 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
 	[Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
 	[pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
@@ -53,6 +56,7 @@
 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
 AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
 AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
+AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" == "yes"])
 
 regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
 	-D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
Index: iptables-1.4.2/Makefile.am
===================================================================
--- iptables-1.4.2.orig/Makefile.am
+++ iptables-1.4.2/Makefile.am
@@ -3,6 +3,10 @@
 AUTOMAKE_OPTIONS = foreign subdir-objects
 
 AM_CFLAGS        = ${regular_CFLAGS} -I${top_builddir}/include -I${top_srcdir}/include ${kinclude_CFLAGS}
+if ENABLE_IPV6
+AM_CFLAGS       += -DENABLE_IPV6=1
+endif
+
 SUBDIRS         := extensions
 if ENABLE_LIBIPQ
 SUBDIRS         += libipq
@@ -80,11 +84,17 @@
 endif
 
 if ENABLE_STATIC
-sbin_PROGRAMS += iptables-static ip6tables-static
+sbin_PROGRAMS += iptables-static
+if ENABLE_IPV6
+sbin_PROGRAMS += ip6tables-static
+endif
+
 endif
 if ENABLE_SHARED
-sbin_PROGRAMS += iptables iptables-multi iptables-restore iptables-save \
-                 ip6tables ip6tables-multi ip6tables-restore ip6tables-save
+sbin_PROGRAMS += iptables iptables-multi iptables-restore iptables-save
+if ENABLE_IPV6
+sbin_PROGRAMS += ip6tables ip6tables-multi ip6tables-restore ip6tables-save
+endif
 endif
 
 iptables.8: ${srcdir}/iptables.8.in extensions/matches4.man extensions/targets4.man
Index: iptables-1.4.2/xtables.c
===================================================================
--- iptables-1.4.2.orig/xtables.c
+++ iptables-1.4.2/xtables.c
@@ -964,6 +964,8 @@
 	}
 }
 
+#ifdef ENABLE_IPV6
+
 const char *ip6addr_to_numeric(const struct in6_addr *addrp)
 {
 	/* 0000:0000:0000:0000:0000:000.000.000.000
@@ -1189,6 +1191,7 @@
 			}
 	}
 }
+#endif
 
 void save_string(const char *value)
 {