Re: TPROXY support in Squid 3

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Mon, 07 Apr 2008 17:23:15 +0200

mån 2008-04-07 klockan 23:11 +1200 skrev Amos Jeffries:
> We have come up with a 'final-beta' patch for squid-3 now.
> http://treenet.co.nz/projects/squid/patches/tproxy-squid-3_20080407.patch
> Just waiting on Laszlo final approval.

Some comments...

There should be a general TPROXY define, shared by all, or the common
os-independent code should always be enabled. I do not want to see #if
LINUX_TPROXY2 || LINUX_TPROXY4 defines in the general code. Such ifs
should only be seen in the lowlevel implementation. And from a code
maintenance perspective it's best is the common code is always built,
just as is done for the transparent interception code. The drawback is
that it costs one or two cpu cycles more per requests even if the
feature is not available on the platform but it's much much less likely
the feature gets broken by other changes.

+ /* 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;
+ }

You need to at least set the internal flag. But you most likely do no
need to make the comm call telling the kernel it's a transparent
connection (it already knows..)

Is this indended?

@@ -652,7 +673,6 @@
     addr.GetAddrInfo(AI);
     AI->ai_socktype = sock_type;
     AI->ai_protocol = proto;
- AI->ai_flags = flags;
 
     debugs(50, 3, "comm_openex: Attempt open socket for: " << addr );
 

Regards
Henrik
Received on Mon Apr 07 2008 - 09:24:55 MDT

This archive was generated by hypermail 2.2.0 : Wed Apr 30 2008 - 12:00:07 MDT