summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--common/smtppass.c8
-rw-r--r--configure.in19
3 files changed, 19 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index 85d1db9..faf13e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,7 +5,9 @@ Makefile.in
.project
.cproject
.settings
+*~
+/test
/install-sh
/configure
/config.sub
diff --git a/common/smtppass.c b/common/smtppass.c
index 4119335..08ea5ef 100644
--- a/common/smtppass.c
+++ b/common/smtppass.c
@@ -45,6 +45,9 @@
#include <sys/socket.h>
#include <sys/param.h>
#include <sys/stat.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
#include <ctype.h>
#include <stdlib.h>
@@ -60,7 +63,8 @@
#include "usuals.h"
-#ifdef LINUX_TRANSPARENT_PROXY
+#if LINUX_NETFILTER
+#include <linux/types.h>
#include <linux/netfilter_ipv4.h>
#endif
@@ -754,7 +758,7 @@ static int make_connections(spctx_t* ctx, int client)
memset(&addr, 0, sizeof(addr));
SANY_LEN(addr) = sizeof(addr);
-#ifdef LINUX_TRANSPARENT_PROXY
+#ifdef LINUX_NETFILTER
if(getsockopt(ctx->client.fd, SOL_IP, SO_ORIGINAL_DST, &SANY_ADDR(addr), &SANY_LEN(addr)) == -1)
#else
if(getsockname(ctx->client.fd, &SANY_ADDR(addr), &SANY_LEN(addr)) == -1)
diff --git a/configure.in b/configure.in
index 8073a2f..321c0a3 100644
--- a/configure.in
+++ b/configure.in
@@ -75,14 +75,17 @@ AC_CHECK_HEADERS([unistd.h stdio.h stddef.h fcntl.h stdlib.h assert.h errno.h st
[echo "ERROR: Required C header missing"; exit 1])
# Check for linux type transparent proxy support
-AC_CHECK_HEADERS([linux/netfilter_ipv4.h],
- AC_DEFINE(LINUX_TRANSPARENT_PROXY, 1, [Whether the system supports a linux type transparent proxy]),
- ,
- [[
- #ifdef HAVE_LIMITS_H
- #include <limits.h>
- #endif
- ]] )
+AC_CHECK_HEADERS([linux/types.h linux/netfilter_ipv4.h],
+ AC_DEFINE(LINUX_NETFILTER, 1, [Whether the system supports a linux type transparent proxy]),
+ ,
+ [[
+ #ifdef HAVE_LIMITS_H
+ #include <limits.h>
+ #endif
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ ]]
+)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST