#include "SquidTime.h"
#include "CommCalls.h"
#include "IPAddress.h"
+#include "IPInterception.h"
#if defined(_SQUID_CYGWIN_)
#include <sys/ioctl.h>
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 */
#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
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;