diff options
author | Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org> | 2014-12-23 10:51:33 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-12-23 10:51:33 -0500 |
commit | 39e71d8fa54afd906fdcaf2cd496c300362ebb9a (patch) | |
tree | 1b4ed9fff0c400eebd5d01f2d42cd022e34e3bea /configure.ac | |
parent | 808e2b856bd77fa9b431272a6f37596655fd5945 (diff) | |
download | tor-39e71d8fa54afd906fdcaf2cd496c300362ebb9a.tar.gz tor-39e71d8fa54afd906fdcaf2cd496c300362ebb9a.zip |
Use the appropriate call to getsockopt for IPv6 sockets
The original call to getsockopt to know the original address on transparently
proxyed sockets using REDIRECT in iptables failed with IPv6 addresses because
it assumed all sockets used IPv4.
This patch fixes this by using the appropriate options and adding the headers
containing the needed definitions for these.
This patch is released under the same license as the original file as
long as the author iscredited.
Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index e7560b2bfc..88b4da006d 100644 --- a/configure.ac +++ b/configure.ac @@ -937,6 +937,14 @@ AC_CHECK_HEADERS(net/pfvar.h, net_pfvar_found=1, net_pfvar_found=0, #ifdef HAVE_NET_IF_H #include <net/if.h> #endif]) + +AC_CHECK_HEADERS(linux/if.h,[],[], +[ +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +]) + AC_CHECK_HEADERS(linux/netfilter_ipv4.h, linux_netfilter_ipv4=1, linux_netfilter_ipv4=0, [#ifdef HAVE_SYS_TYPES_H @@ -958,6 +966,30 @@ AC_CHECK_HEADERS(linux/netfilter_ipv4.h, #include <netinet/in.h> #endif]) +AC_CHECK_HEADERS(linux/netfilter_ipv6/ip6_tables.h, + linux_netfilter_ipv6_ip6_tables=1, linux_netfilter_ipv6_ip6_tables=0, +[#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif +#ifdef HAVE_LINUX_TYPES_H +#include <linux/types.h> +#endif +#ifdef HAVE_NETINET_IN6_H +#include <netinet/in6.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_LINUX_IF_H +#include <linux/if.h> +#endif]) + if test x$transparent = xtrue ; then transparent_ok=0 if test x$net_if_found = x1 && test x$net_pfvar_found = x1 ; then @@ -966,6 +998,9 @@ if test x$transparent = xtrue ; then if test x$linux_netfilter_ipv4 = x1 ; then transparent_ok=1 fi + if test x$linux_netfilter_ipv6_ip6_tables = x1 ; then + transparent_ok=1 + fi if test x$transparent_ok = x1 ; then AC_DEFINE(USE_TRANSPARENT, 1, "Define to enable transparent proxy support") case $host in |