]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Compile errors with --enable-linux-tproxy4 set
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 31 Mar 2008 04:01:31 +0000 (16:01 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 31 Mar 2008 04:01:31 +0000 (16:01 +1200)
src/comm.cc
src/fde.h

index e839425420a30b1cff3d7ce921f71963ac9e5f34..cba736622607a5487a501aa91b2f34839728fd19 100644 (file)
@@ -48,6 +48,7 @@
 #include "SquidTime.h"
 #include "CommCalls.h"
 #include "IPAddress.h"
+#include "IPInterception.h"
 
 #if defined(_SQUID_CYGWIN_)
 #include <sys/ioctl.h>
@@ -634,6 +635,10 @@ comm_set_transparent(int fd, int tos)
     if (setsockopt(fd, SOL_IP, IP_TRANSPARENT, (char *) &tos, sizeof(int)) < 0) {
         debugs(50, DBG_IMPORTANT, "comm_open: setsockopt(IP_TRANSPARENT) on FD " << fd << ": " << xstrerror());
     }
+    else {
+        /* mark the socket as having transparent options */
+        fd_table[fd].flags.transparent = 1;
+    }
 #else
     debugs(50, DBG_CRITICAL, "WARNING: comm_open: setsockopt(IP_TRANSPARENT) not supported on this platform");
 #endif /* sockopt */
@@ -1321,9 +1326,9 @@ comm_old_accept(int fd, ConnectionDetail &details)
 
 #if LINUX_TPROXY4
     /* AYJ: do we need to set this again on every accept? */
-    if(fd_table[fd].flags.tproxy == 1) {
+    if(fd_table[fd].flags.transparent == 1) {
         comm_set_transparent(sock, 0);
-        F->flags.tproxy = 1;
+        F->flags.transparent = 1;
     }
 #endif
 
index e4875b5449eeea28580c899c120762f95c1cf62d..4322701b72b963316fc6093ccaf4024ec4136495 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
@@ -82,6 +82,9 @@ public:
        unsigned int close_on_exec:1;
        unsigned int read_pending:1;
        unsigned int write_pending:1;
+#if LINUX_TPROXY4
+        unsigned int transparent:1;
+#endif
     } flags;
 
     int64_t bytes_read;