]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Migrate uses of comm_set_transparent to using comm_openex flag instead.
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 7 Apr 2008 10:40:15 +0000 (22:40 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 7 Apr 2008 10:40:15 +0000 (22:40 +1200)
Cleaner and reduces the overall Comm API.
IPv6 update had incorrectly interpreted comm_open flags as ai_flags.
  (same context, different actual name/values)

src/comm.cc
src/comm.h
src/forward.cc

index a3c4a274f8031f28e7b2140f93d2ccfa4e0d7e52..384f574523cbb6b093854b76b25a9c03ae98a0d5 100644 (file)
@@ -628,6 +628,9 @@ comm_set_v6only(int fd, int tos)
 #endif /* sockopt */
 }
 
+/**
+ * Set the socket IP_TRANSPARENT option for Linux TPROXY v4 support.
+ */
 void
 comm_set_transparent(int fd)
 {
@@ -773,7 +776,6 @@ comm_openex(int sock_type,
 #if LINUX_TPROXY4
     if((flags & COMM_TRANSPARENT)) {
         comm_set_transparent(new_socket);
-        F->flags.transparent = 1;
     }
 #endif
 
@@ -1349,7 +1351,7 @@ comm_old_accept(int fd, ConnectionDetail &details)
     commSetNonBlocking(sock);
 
 #if LINUX_TPROXY4
-    /* AYJ: do we need to set this again on every accept? */
+    /* AYJ: do we actually need to set this again on every accept? */
     if(fd_table[fd].flags.transparent == 1) {
         comm_set_transparent(sock);
         F->flags.transparent = 1;
index f3068cfb06825797e4589216462b765fd7eee7d2..b87df719b9d892fd4da450ef251e429d85016d52 100644 (file)
@@ -56,11 +56,6 @@ SQUIDCEXTERN int comm_openex(int, int, IPAddress &, int, unsigned char TOS, cons
 SQUIDCEXTERN u_short comm_local_port(int fd);
 SQUIDCEXTERN int comm_set_tos(int fd, int tos);
 
-/**
- * Set the socket IP_TRANSPARENT option for Linux TPROXY v4 support.
- */
-SQUIDCEXTERN void comm_set_transparent(int fd);
-
 SQUIDCEXTERN void commSetSelect(int, unsigned int, PF *, void *, time_t);
 SQUIDCEXTERN void commResetSelect(int);
 
index 139188a7ad8c804600e3271cabc262924af6348f..daea20d824d3b2f5497c99d1707416cd2d548b4c 100644 (file)
@@ -892,14 +892,8 @@ FwdState::connectStart()
         hierarchyNote(&request->hier, fs->code, fs->_peer->host);
     } else {
 
-#if LINUX_TPROXY2 || LINUX_TPROXY4
-
+#if LINUX_TPROXY2
         if (request->flags.tproxy) {
-
-#if LINUX_TPROXY4
-            comm_set_transparent(fd);
-
-#elif LINUX_TPROXY2
             IPAddress addr;
 
             src.GetInAddr(itp.v.addr.faddr);