iptables-optional-ipv6.patch 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Make ipv6 support optional. Patch by Steffen Schulz <sf@cbg.dyndns.org>
  2. Submitted upstream as http://bugzilla.netfilter.org/show_bug.cgi?id=588
  3. ---
  4. Makefile.am | 16 +++++++++++++---
  5. configure.ac | 4 ++++
  6. xtables.c | 3 +++
  7. 3 files changed, 20 insertions(+), 3 deletions(-)
  8. Index: iptables-1.4.2/configure.ac
  9. ===================================================================
  10. --- iptables-1.4.2.orig/configure.ac
  11. +++ iptables-1.4.2/configure.ac
  12. @@ -37,6 +37,9 @@
  13. [enable_devel="$enableval"], [enable_devel="yes"])
  14. AC_ARG_ENABLE([libipq],
  15. AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
  16. +AC_ARG_ENABLE([ipv6],
  17. + AS_HELP_STRING([--enable-ipv6], [Build and install ip6tables]),
  18. + [enable_ipv6="$enableval"], [enable_ipv6="yes"])
  19. AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
  20. [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
  21. [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
  22. @@ -53,6 +56,7 @@
  23. AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
  24. AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
  25. AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
  26. +AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" == "yes"])
  27. regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
  28. -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
  29. Index: iptables-1.4.2/Makefile.am
  30. ===================================================================
  31. --- iptables-1.4.2.orig/Makefile.am
  32. +++ iptables-1.4.2/Makefile.am
  33. @@ -3,6 +3,10 @@
  34. AUTOMAKE_OPTIONS = foreign subdir-objects
  35. AM_CFLAGS = ${regular_CFLAGS} -I${top_builddir}/include -I${top_srcdir}/include ${kinclude_CFLAGS}
  36. +if ENABLE_IPV6
  37. +AM_CFLAGS += -DENABLE_IPV6=1
  38. +endif
  39. +
  40. SUBDIRS := extensions
  41. if ENABLE_LIBIPQ
  42. SUBDIRS += libipq
  43. @@ -80,11 +84,17 @@
  44. endif
  45. if ENABLE_STATIC
  46. -sbin_PROGRAMS += iptables-static ip6tables-static
  47. +sbin_PROGRAMS += iptables-static
  48. +if ENABLE_IPV6
  49. +sbin_PROGRAMS += ip6tables-static
  50. +endif
  51. +
  52. endif
  53. if ENABLE_SHARED
  54. -sbin_PROGRAMS += iptables iptables-multi iptables-restore iptables-save \
  55. - ip6tables ip6tables-multi ip6tables-restore ip6tables-save
  56. +sbin_PROGRAMS += iptables iptables-multi iptables-restore iptables-save
  57. +if ENABLE_IPV6
  58. +sbin_PROGRAMS += ip6tables ip6tables-multi ip6tables-restore ip6tables-save
  59. +endif
  60. endif
  61. iptables.8: ${srcdir}/iptables.8.in extensions/matches4.man extensions/targets4.man
  62. Index: iptables-1.4.2/xtables.c
  63. ===================================================================
  64. --- iptables-1.4.2.orig/xtables.c
  65. +++ iptables-1.4.2/xtables.c
  66. @@ -964,6 +964,8 @@
  67. }
  68. }
  69. +#ifdef ENABLE_IPV6
  70. +
  71. const char *ip6addr_to_numeric(const struct in6_addr *addrp)
  72. {
  73. /* 0000:0000:0000:0000:0000:000.000.000.000
  74. @@ -1189,6 +1191,7 @@
  75. }
  76. }
  77. }
  78. +#endif
  79. void save_string(const char *value)
  80. {