summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2010-11-01 12:44:07 -0600
committerStef Walter <stef@thewalter.net>2011-01-23 15:47:45 -0600
commit64183ac418dd2e3e13fca69c3294d3a25ba2700e (patch)
treee8489d4c83a4edb58151bc88a6e0f30f04904984
parent98aa28ac8799d5d69687c1205beeef4441d25b4d (diff)
Fix the build on ubuntu 10.4
-rw-r--r--common/spio.c16
-rw-r--r--configure.in25
2 files changed, 26 insertions, 15 deletions
diff --git a/common/spio.c b/common/spio.c
index 01993fb..992e2df 100644
--- a/common/spio.c
+++ b/common/spio.c
@@ -35,6 +35,8 @@
* Stef Walter <stef@memberwebs.com>
*/
+#include "config.h"
+
/*
* select() and stdio are basically mutually exclusive.
* Hence all of this code to try to get some buffering
@@ -47,13 +49,6 @@
#include <sys/param.h>
#include <sys/stat.h>
-#include <netinet/in.h>
-
-#ifdef HAVE_IP_TRANSPARENT
-#include <linux/types.h>
-#include <linux/netfilter_ipv4.h>
-#endif
-
#include <ctype.h>
#include <stdio.h>
#include <unistd.h>
@@ -64,6 +59,13 @@
#include <unistd.h>
#include <errno.h>
+#include <netinet/in.h>
+
+#ifdef HAVE_IP_TRANSPARENT
+#include <linux/types.h>
+#include <linux/netfilter_ipv4.h>
+#endif
+
#include "compat.h"
#include "usuals.h"
#include "sock_any.h"
diff --git a/configure.in b/configure.in
index c6adc86..c5de976 100644
--- a/configure.in
+++ b/configure.in
@@ -122,20 +122,29 @@ if test "$enable_tproxy" = "yes"; then
[have_tproxy="yes"],
[have_tproxy="no"],
[[
- #ifdef HAVE_LIMITS_H
- #include <limits.h>
- #endif
#include <sys/socket.h>
#include <netinet/in.h>
- #include <linux/types.h>
- #include <linux/netfilter_ipv4.h>
]]
)
- if test "$enable_tproxy" = "yes"; then
- AC_DEFINE(HAVE_IP_TRANSPARENT, $have_tproxy, "Linux transparent proxy")
+ if test "$have_tproxy" = "yes"; then
+ AC_DEFINE(HAVE_IP_TRANSPARENT, 1, [Linux transparent proxy])
+
else
- AC_MSG_ERROR([Only linux 2.6.28 and later support true transparent proxy. See --disable-tproxy])
+ AC_MSG_CHECKING([whether broken IP_TRANSPARENT definition is present])
+ AC_COMPILE_IFELSE([[
+ #include <sys/socket.h>
+ #include <linux/in.h>
+ int main (void) { return IP_TRANSPARENT == 19; }
+ ]], [have_tproxy="yes"], [have_tproxy="no"])
+ AC_MSG_RESULT([$have_tproxy])
+
+ if test "$have_tproxy" = "yes"; then
+ AC_DEFINE(HAVE_IP_TRANSPARENT, 1, [Linux transparent proxy])
+ AC_DEFINE(IP_TRANSPARENT, 19, [Fix missing linux header definition])
+ else
+ AC_MSG_ERROR([Only linux 2.6.28 and later support true transparent proxy. See --disable-tproxy])
+ fi
fi
fi