From: "Wes L. Zuber" Note that once the patch is installed it can be turned off in the client_side.c file by commenting out the "DANSGUARDIAN_IP_FORWARD" define. 1. Copy the patch to a file.. and name it something like dans_to_squid.patch. 2. Then move the file into the Squid expanded directory. It should be something like: squid-2.4.STABLE4/ 3. CD to the directory 4. Run: patch -Np1 < ../dans_to_squid.patch 5. You should get a successful patch. Then recompile everything and install. Go to go! diff -ru squid-2.4.STABLE4/src/client_side.c squid-2.4.STABLE4.new/src/client_side.c --- squid-2.4.STABLE4/src/client_side.c Fri Apr 20 16:21:41 2001 +++ squid-2.4.STABLE4.new/src/client_side.c Fri Nov 1 08:14:07 2002 @@ -74,7 +74,7 @@ static const char *const crlf = "\r\n"; #define FAILURE_MODE_TIME 300 - +#define DANSGUARDIAN_IP_FORWARD /* Local functions */ static CWCB clientWriteComplete; @@ -695,6 +695,9 @@ clientHttpRequest **H; ConnStateData *conn = http->conn; StoreEntry *e; +#ifdef DANSGUARDIAN_IP_FORWARD + String s; +#endif request_t *request = http->request; MemObject *mem = NULL; debug(33, 3) ("httpRequestFree: %s\n", storeUrl(http->entry)); @@ -725,7 +728,15 @@ http->al.http.code = mem->reply->sline.status; http->al.http.content_type = strBuf(mem->reply->content_type); } + http->al.cache.caddr = conn->log_addr; +#ifdef DANSGUARDIAN_IP_FORWARD + if (httpHeaderHas(&request->header, HDR_X_FORWARDED_FOR)) { + s = httpHeaderGetList(&request->header, HDR_X_FORWARDED_FOR); + if (! inet_pton (AF_INET,strBuf(s),&http->al.cache.caddr)) + http->al.cache.caddr = conn->log_addr; + } +#endif http->al.cache.size = http->out.size; http->al.cache.code = http->log_type; http->al.cache.msec = tvSubMsec(http->start, current_time);