Bug 3011 - squid 3.1.6 doesn't work on ipv4-only systems
Summary: squid 3.1.6 doesn't work on ipv4-only systems
Status: RESOLVED DUPLICATE of bug 2994
Alias: None
Product: Squid
Classification: Unclassified
Component: other (show other bugs)
Version: 3.1
Hardware: All Linux - All
: P2 critical
Assignee: Amos Jeffries
URL:
Depends on:
Blocks:
 
Reported: 2010-08-10 03:41 UTC by Leonid Kabanov
Modified: 2010-08-11 05:01 UTC (History)
1 user (show)

See Also:
Browser: ---
Fixed Versions:
Needs:


Attachments
modified patch for 3.1.6 (4.32 KB, patch)
2010-08-10 06:31 UTC, Leonid Kabanov
Details
ICAP IPv4 protections. (4.17 KB, patch)
2010-08-10 17:03 UTC, Amos Jeffries
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leonid Kabanov 2010-08-10 03:41:12 UTC
When try to open https://mail.google.com I get these errors in cache.log:
2010/08/10 17:05:37| comm_open: socket failure: (97) Address family not supported by protocol
I try to debug and find that comm_openex try to open ipv6 address instead of ipv4. I've have ipv4-only system (ipv6 disabled in kernel) and squid compiled with --disable-ipv6 configure option. This can be "fixed" with tcp_outgoing_address option but I've 2 external interfaces and I cannot bind exclusively to one of them. So I put "temp.SetIPv4();" in ./src/tunnel.cc (line 644, after "IpAddress temp = getOutgoingAddr(request,NULL);"). That fix the problem.
Also:
1. IpAddress::ToHostname always return ipv6 address if IsAnyAddr() or IsNoAddr() is true - no checks for --disable-ipv6
2. IpAddress::NtoA always return "::" if IsAnyAddr() are true - no checks for --disable-ipv6
Comment 1 Amos Jeffries 2010-08-10 04:43:07 UTC
Thank you. I just added a fix for this.
Please try this patch and report back here.

http://west.squid-cache.org/Versions/v3/3.HEAD/changesets/squid-3-10722.patch
 (was diff'ed for 3.HEAD, but should apply easily to 3.1).
Comment 2 Chris Palmer 2010-08-10 06:24:41 UTC
(In reply to comment #1)
> Thank you. I just added a fix for this.
> Please try this patch and report back here.
> 
> http://west.squid-cache.org/Versions/v3/3.HEAD/changesets/squid-3-10722.patch
>  (was diff'ed for 3.HEAD, but should apply easily to 3.1).


Amos
I'm having the same problem, so just tried this patch (against 3.1.6). Unfortunately the patch for tunnel.cc fails...

I think there is another part that needs patching too though. I use ICAP, and get the following the first time squid attempts to access the ICAP service:

2010/08/02 10:28:42| comm_open: socket failure: (97) Address family not supported by protocol
2010/08/02 10:28:42| essential ICAP service is down after an options fetch failure: icap://localhost:1344/srv_clamav [down,!opt]

I have ipv6 disabled in the kernel, and squid built with --disable-ipv6.

Many thanks
Chris
Comment 3 Leonid Kabanov 2010-08-10 06:31:14 UTC
Created attachment 2237 [details]
modified patch for 3.1.6

I modify original patch. It fix my problem.
Comment 4 Amos Jeffries 2010-08-10 17:02:51 UTC
Thanks Leonid. Applying the updates. Will be in 3.1.7.
Comment 5 Amos Jeffries 2010-08-10 17:03:43 UTC
Created attachment 2238 [details]
ICAP IPv4 protections.

Chris: please test this for the ICAP problem.
Comment 6 Chris Palmer 2010-08-11 02:43:04 UTC
(In reply to comment #5)
> Created attachment 2238 [details]
> ICAP IPv4 protections.
> 
> Chris: please test this for the ICAP problem.

Hi Amos
There is a typo in the patch which nukes the config parsing - in the line
    else if (strcmp(name, "ipv6") == 0) {
the "else" is missing at the start...

Once I put the missing "else" in it worked like a charm

Many thanks
Chris
Comment 7 Amos Jeffries 2010-08-11 05:01:23 UTC
Great news. Thank you for your help testing and fixing.
Fixes applied to Squid-3. will be in 3.1.7.

NP: marking as duplicate of bug 2994 since they are two parts of the same regression.

*** This bug has been marked as a duplicate of bug 2994 ***