From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Sep 21 14:56:08 2014 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C53F4F94 for ; Sun, 21 Sep 2014 14:56:08 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5EC21F2 for ; Sun, 21 Sep 2014 14:56:08 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LEu8Io041604 for ; Sun, 21 Sep 2014 14:56:08 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 193813] New: www/squid TP_PF does not work, especially inside jail Date: Sun, 21 Sep 2014 14:56:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports Tree X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: osho@pcc-software.org X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-ports-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 14:56:09 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193813 Bug ID: 193813 Summary: www/squid TP_PF does not work, especially inside jail Product: Ports Tree Version: Latest Hardware: Any OS: Any Status: Needs Triage Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: freebsd-ports-bugs@FreeBSD.org Reporter: osho@pcc-software.org I installed www/squid with TP_PF (transparent proxy on packet filter) in jail of my FreeBSD router machine. When I tried to connect to a certain external web server, it showed a log like followings in access.log, and my browser got access denied error: | 2014/09/20 21:34:06 kid1| WARNING: Forwarding loop detected for: | GET / HTTP/1.1 | Host: www.example.com | Accept: application/json, text/javascript, */*; q=0.01 | User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36 | X-Chrome-UMA-Enabled: 1 | Accept-Encoding: gzip,deflate,sdch | Accept-Language: ja,en-US;q=0.8,en;q=0.6 | Via: 1.1 example.example.org (squid/3.4.8) | X-Forwarded-For: 172.16.0.1 | Cache-Control: max-age=0 | Connection: keep-alive What is your env? FreeBSD 10.0-STABLE r268457 How to repeat? My "router" FreeBSD machine has two network cards, one is for internal network, and the other is for external network. The steps is like followings: 1. Install www/squid in jail from ports. Don't forget to set TP_PF (Transparent proxy with packet filter). 2. configure squid.conf to listen on 8080 with intercept option. | http_port 8080 intercept 3. configure pf.conf to redirect connection on internal network interface from internal network to external network port 80 to the squid like: | rdr pass on $int_if inet proto tcp from $internal_net to ! port http -> $squid port 8080 Then, you will see the same issue written above. As far as I checked with sockstat command, squid seems to tried to connect to its port 8080. I did not investigate why it tried to connect that port, though. Workaround? Workaround 1: do not use transparent proxy. If I connect to squid not as transparent proxy, i.e. set each browser HTTP proxy host and port, it works. However, it is very annoying. Workaround 2: use www/squid33 instead of www/squid. If I use www/squid33, I did not see the issue. However, it will be removed in next January. | DEPRECATED= Reached EOL on 28 August 2014, use www/squid (v3.4) instead | EXPIRATION_DATE=2015-01-31 When I roughly compared www/squid33 and www/squid, I noticed that www/squid do not use /dev/pf. According to work/squid-3.4.8/src/ip/Intercept.cc, it seems that USE_NAT_DEVPF should be defined to use /dev/pf on www/squid. -- You are receiving this mail because: You are the assignee for the bug.