From: Amos Jeffries Date: Mon, 7 Apr 2008 10:40:15 +0000 (+1200) Subject: Migrate uses of comm_set_transparent to using comm_openex flag instead. X-Git-Tag: BASIC_TPROXY4~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40d6264ddb0da6df71ffcc898bae7838640b18e4;p=thirdparty%2Fsquid.git Migrate uses of comm_set_transparent to using comm_openex flag instead. Cleaner and reduces the overall Comm API. IPv6 update had incorrectly interpreted comm_open flags as ai_flags. (same context, different actual name/values) --- diff --git a/src/comm.cc b/src/comm.cc index a3c4a274f8..384f574523 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -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; diff --git a/src/comm.h b/src/comm.h index f3068cfb06..b87df719b9 100644 --- a/src/comm.h +++ b/src/comm.h @@ -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); diff --git a/src/forward.cc b/src/forward.cc index 139188a7ad..daea20d824 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -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);