Re: Very odd problem running squid 2.7 on Windows

2009-05-24 Thread Amos Jeffries

Guido Serassio wrote:

Hi,

One user has reported a very strange problem using cache_peer directive 
on 2.7 STABLE6 running on Windows:


When using the following config:

cache_peer 192.168.0.63 parent 3329 0 no-query
cache_peer rea.acmeconsulting.loc parent 3328 3130

the result is always:

2009/05/23 12:35:28| Configuring 192.168.0.63 Parent 192.168.0.63/3329/0
2009/05/23 12:35:28| Configuring rea.acmeconsulting.loc Parent 
rea.acmeconsulting.loc/13/3130


Very odd 

Debugging the code, I have found where is situated the problem.

The following if GetService() from cache_cf.c:

static u_short
GetService(const char *proto)
{
struct servent *port = NULL;
char *token = strtok(NULL, w_space);
if (token == NULL) {
self_destruct();
return -1;  /* NEVER REACHED */
}
port = getservbyname(token, proto);
if (port != NULL) {
return ntohs((u_short) port-s_port);
}
return xatos(token);
}

When the value of port-s_port is 3328, ntohs() always returns 13.
Other values seems to work fine.

Any idea ?


Are you certain it's ntohs() and not a rogue entry in their services 
file defining 3328? The service match is text-wise.


Amos
--
Please be using
  Current Stable Squid 2.7.STABLE6 or 3.0.STABLE15
  Current Beta Squid 3.1.0.8 or 3.0.STABLE16-RC1


Re: [squid-users] Error making squid-3.1.0.7-20090412 on Mac OS X 10.4

2009-05-24 Thread Amos Jeffries

vollkom...@gmx.net wrote:

 Original-Nachricht 

1. DNS lookups fail completely. 204.127.198.4 is among a handful of
external DNS servers I use, whether defined as dns_nameservers in
squid.conf or picked by squid automatically from /etc/resolv.conf:

2009/05/20 21:44:49| comm_udp_sendto: FD 8, (family=2) 204.127.198.4:53:
(22) Invalid argument
2009/05/20 21:44:49| idnsSendQuery: FD 8: sendto: (22) Invalid argument
2009/05/20 21:46:10| comm_set_tos: setsockopt(IP_TOS) on FD 7: (22)
Invalid argument

Is IPv6 dual-stack enabled in your OS? it looks like the v6 sockets are
unable to do the v4-mapping they need to handle v4 traffic.
I find it a bit weird that setting TOS also fails, its one of the older
functionality and shared between both IP protocols.



I'd think so. I'm using 6to4, if that matters. Here's the snippet from 
config.log:t

configure:25519: checking whether to enable IPv6
configure:25534: result: yes
configure:25548: checking if PF_INET6 is available
configure:25583: g++ -o conftest  -g -O2   -g conftest.cpp   5
configure:25587: $? = 0
configure:25593: ./conftest
configure:25597: $? = 0
configure:25599: result: yes
configure:25624: result: 
configure:25643: checking for IPv6 split-stack requirement

configure:25666: result: no
configure:25672: checking for sin6_len field in struct sockaddr_in6
configure:25703: g++ -c  -g -O2  conftest.cpp 5
configure:25710: $? = 0
configure:25727: result: yes
...
#define USE_IPV6 1
#define IPV6_SPECIAL_V4MAPPED 1
#define IPV6_SPECIAL_SPLITSTACK 0

Here's cache.log with debug_options 0,5 78,9:

2009/05/20 23:36:23.570| idnsALookup: buf is 36 bytes for www.ipv6.sixxs.net, 
id = 0x7fca
2009/05/20 23:36:23.570| comm_udp_sendto: FD 7, (family=2) 18.70.0.160:53: (22) 
Invalid argument
2009/05/20 23:36:23.570| idnsSendQuery: FD 7: sendto: (22) Invalid argument


2. Does that above have anything to do with the failure to apply this
patch?

patch -p0  b9691.patch
patching file src/dnsserver.cc
Hunk #1 FAILED at 427.
Hunk #2 FAILED at 436.
2 out of 2 hunks FAILED -- saving rejects to file src/dnsserver.cc.rej

I hope not. That patch does not alter anything functionally and is
internal to the obsolete dnsserver helper.


3. I see the following in cache.log. I realize they're warnings, but is
there any way to make squid happy? I thought the slash format is a

CIDR

mask.

WARNING: Netmasks are deprecated. Please use CIDR masks instead.
WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6

to

IPv4 ranges.

squid.conf:
acl sitelocalsrc src fec0::/48
acl linklocalsrc src fe80::/64

The conf is correct, if the warnings are appearing on that line something
has definitely broken.

Tomorrow is my actually scheduled day for squid maintenance. I will have
to look at these closer after the maintenance work.

Amos



Turns out my previous conjecture was wrong. Those warnings appear even after 
I've commented out all the IPv6 bits in the ACLs. Here' the complete lines from 
cache.log, in case it matters:

2009/05/20 23:46:02| WARNING: Netmasks are deprecated. Please use CIDR masks 
instead.
2009/05/20 23:46:02| WARNING: IPv4 netmasks are particularly nasty when used to 
compare IPv6 to IPv4 ranges.
2009/05/20 23:46:02| WARNING: For now we assume you meant to write /12
2009/05/20 23:46:02| WARNING: Netmasks are deprecated. Please use CIDR masks 
instead.
2009/05/20 23:46:02| WARNING: IPv4 netmasks are particularly nasty when used to 
compare IPv6 to IPv4 ranges.
2009/05/20 23:46:02| WARNING: For now we assume you meant to write /12


Sorry I didn't get to this a few days ago.

Are you using the default squid.conf that gets built with 3.1 or an 
altered version?
Problem #3 will show up for some settings even though there is not yet 
any other way to do them than netmasks. So it needs to be looked at but 
in some cases can be ignored.


Problem #1, I'm still thinking about.

Amos
--
Please be using
  Current Stable Squid 2.7.STABLE6 or 3.0.STABLE15
  Current Beta Squid 3.1.0.8 or 3.0.STABLE16-RC1


Re: [MERGE] Language Updates

2009-05-24 Thread Bundle Buggy

Bundle Buggy has detected this merge request.

For details, see: 
http://bundlebuggy.aaronbentley.com/project/squid/request/%3C20090517101856.252BA88D4B%40treenet.co.nz%3E

Project: Squid


Re: Very odd problem running squid 2.7 on Windows

2009-05-24 Thread Guido Serassio

Hi,

At 04.38 24/05/2009, Adrian Chadd wrote:

Can you craft a small C program to replicate the behaviour?


Sure, I wrote the following test program:

#include stdio.h
#include Winsock2.h

void main(void)
{
u_short i, converted;
WSADATA wsaData;
struct servent *port = NULL;
char token[32];
const char proto[] = tcp;

WSAStartup(2, wsaData);

for (i=1; i65535; i++)
{
sprintf(token, %d, i);
port = getservbyname(token, proto);
if (port != NULL) {
converted=ntohs((u_short) port-s_port);
if (i != converted)
printf(%d %d\n, i, converted);
   }
}
WSACleanup();
}

And this is the result on my Windows XP x64 machine (similar results 
on Windows 2000 and Vista):


2 512
258 513
524 3074
770 515
782 3587
1288 2053
1792 7
1807 3847
2050 520
2234 47624
2304 9
2311 1801
2562 522
2564 1034
2816 11
3328 13
3586 526
3853 3343
4352 17
4354 529
4610 530
4864 19
4866 531
5120 20
5122 532
5376 21
5632 22
5888 23
6400 25
7170 540
7938 543
8194 544
8706 546
8962 547
9472 37
10752 42
10767 3882
11008 43
11266 556
12054 5679
13058 563
13568 53
13570 565
13579 2869
14380 11320
14856 2106
15372 3132
15629 3389
16165 9535
16897 322
17920 70
18182 1607
18183 1863
19977 2382
20224 79
20233 2383
20480 80
20736 81
20738 593
21764 1109
22528 88
22550 5720
22793 2393
23049 2394
23809 349
24335 3935
25602 612
25856 101
25858 613
26112 102
27392 107
27655 1900
27904 109
28160 110
28416 111
28928 113
29952 117
30208 118
30222 3702
30464 119
31746 636
34049 389
34560 135
35072 137
35584 139
36106 2701
36362 2702
36608 143
36618 2703
36874 2704
37905 4500
38400 150
38919 1944
39173 1433
39426 666
39429 1434
39936 156
39945 2460
40448 158
42250 2725
43520 170
44806 1711
45824 179
45826 691
47383 6073
47624 2234
47873 443
47878 1723
48385 445
49166 3776
49664 194
49926 1731
50188 3268
50437 1477
50444 3269
50693 1478
51209 2504
52235 3020
53005 3535
53249 464
53510 1745
54285 3540
55309 3544
56070 1755
56579 989
56585 2525
56835 990
57347 992
57603 993
57859 994
58115 995
59397 1512
60674 749
62469 1524
62980 1270
64257 507
65040 4350

It seems that sometime (!!!) getservbyname() will incorrectly return 
something ...


Regards

Guido



adrian

2009/5/24 Guido Serassio guido.seras...@acmeconsulting.it:
 Hi,

 One user has reported a very strange problem using cache_peer directive on
 2.7 STABLE6 running on Windows:

 When using the following config:

 cache_peer 192.168.0.63 parent 3329 0 no-query
 cache_peer rea.acmeconsulting.loc parent 3328 3130

 the result is always:

 2009/05/23 12:35:28| Configuring 192.168.0.63 Parent 192.168.0.63/3329/0
 2009/05/23 12:35:28| Configuring rea.acmeconsulting.loc Parent
 rea.acmeconsulting.loc/13/3130

 Very odd 

 Debugging the code, I have found where is situated the problem.

 The following if GetService() from cache_cf.c:

 static u_short
 GetService(const char *proto)
 {
struct servent *port = NULL;
char *token = strtok(NULL, w_space);
if (token == NULL) {
self_destruct();
return -1;  /* NEVER REACHED */
}
port = getservbyname(token, proto);
if (port != NULL) {
return ntohs((u_short) port-s_port);
}
return xatos(token);
 }

 When the value of port-s_port is 3328, ntohs() always returns 13.
 Other values seems to work fine.

 Any idea ?

 Regards

 Guido



 -
 
 Guido Serassio
 Acme Consulting S.r.l. - Microsoft Certified Partner
 Via Lucia Savarino, 1   10098 - Rivoli (TO) - ITALY
 Tel. : +39.011.9530135  Fax. : +39.011.9781115
 Email: guido.seras...@acmeconsulting.it
 WWW: http://www.acmeconsulting.it/





-

Guido Serassio
Acme Consulting S.r.l. - Microsoft Certified Partner
Via Lucia Savarino, 1   10098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135  Fax. : +39.011.9781115
Email: guido.seras...@acmeconsulting.it
WWW: http://www.acmeconsulting.it/



storeurl_rewrite and vary

2009-05-24 Thread Mark Nottingham
Can those familiar with the ins and outs of the Vary implementation  
have a quick look at

  http://www.squid-cache.org/bugs/show_bug.cgi?id=2678
to see if I'm on the right track?

If so, I'll come up with a patch, as well as one for 1947 (which looks  
to be quite similar).


Cheers,

--
Mark Nottingham   m...@yahoo-inc.com




Re: Very odd problem running squid 2.7 on Windows

2009-05-24 Thread Adrian Chadd
Well as Amos said, this isn't the way to call getservbyname().

getservbyname() doesn't translate ports to ports; it translates
tcp/udp service names to ports. It should be returning NULL if it
can't find the service string in the file.

Methinks numeric values shouldn't be handed to getservbyname() under Windows. :)

adrian

2009/5/24 Guido Serassio guido.seras...@acmeconsulting.it:
 Hi,

 At 04.38 24/05/2009, Adrian Chadd wrote:

 Can you craft a small C program to replicate the behaviour?

 Sure, I wrote the following test program:

 #include stdio.h
 #include Winsock2.h

 void main(void)
 {
    u_short i, converted;
    WSADATA wsaData;
    struct servent *port = NULL;
    char token[32];
    const char proto[] = tcp;

    WSAStartup(2, wsaData);

    for (i=1; i65535; i++)
    {
        sprintf(token, %d, i);
        port = getservbyname(token, proto);
        if (port != NULL) {
            converted=ntohs((u_short) port-s_port);
            if (i != converted)
                printf(%d %d\n, i, converted);
       }
    }
    WSACleanup();
 }

 And this is the result on my Windows XP x64 machine (similar results on
 Windows 2000 and Vista):

 2 512
 258 513
 524 3074
 770 515
 782 3587
 1288 2053
 1792 7
 1807 3847
 2050 520
 2234 47624
 2304 9
 2311 1801
 2562 522
 2564 1034
 2816 11
 3328 13
 3586 526
 3853 3343
 4352 17
 4354 529
 4610 530
 4864 19
 4866 531
 5120 20
 5122 532
 5376 21
 5632 22
 5888 23
 6400 25
 7170 540
 7938 543
 8194 544
 8706 546
 8962 547
 9472 37
 10752 42
 10767 3882
 11008 43
 11266 556
 12054 5679
 13058 563
 13568 53
 13570 565
 13579 2869
 14380 11320
 14856 2106
 15372 3132
 15629 3389
 16165 9535
 16897 322
 17920 70
 18182 1607
 18183 1863
 19977 2382
 20224 79
 20233 2383
 20480 80
 20736 81
 20738 593
 21764 1109
 22528 88
 22550 5720
 22793 2393
 23049 2394
 23809 349
 24335 3935
 25602 612
 25856 101
 25858 613
 26112 102
 27392 107
 27655 1900
 27904 109
 28160 110
 28416 111
 28928 113
 29952 117
 30208 118
 30222 3702
 30464 119
 31746 636
 34049 389
 34560 135
 35072 137
 35584 139
 36106 2701
 36362 2702
 36608 143
 36618 2703
 36874 2704
 37905 4500
 38400 150
 38919 1944
 39173 1433
 39426 666
 39429 1434
 39936 156
 39945 2460
 40448 158
 42250 2725
 43520 170
 44806 1711
 45824 179
 45826 691
 47383 6073
 47624 2234
 47873 443
 47878 1723
 48385 445
 49166 3776
 49664 194
 49926 1731
 50188 3268
 50437 1477
 50444 3269
 50693 1478
 51209 2504
 52235 3020
 53005 3535
 53249 464
 53510 1745
 54285 3540
 55309 3544
 56070 1755
 56579 989
 56585 2525
 56835 990
 57347 992
 57603 993
 57859 994
 58115 995
 59397 1512
 60674 749
 62469 1524
 62980 1270
 64257 507
 65040 4350

 It seems that sometime (!!!) getservbyname() will incorrectly return
 something ...

 Regards

 Guido


 adrian

 2009/5/24 Guido Serassio guido.seras...@acmeconsulting.it:
  Hi,
 
  One user has reported a very strange problem using cache_peer directive
  on
  2.7 STABLE6 running on Windows:
 
  When using the following config:
 
  cache_peer 192.168.0.63 parent 3329 0 no-query
  cache_peer rea.acmeconsulting.loc parent 3328 3130
 
  the result is always:
 
  2009/05/23 12:35:28| Configuring 192.168.0.63 Parent 192.168.0.63/3329/0
  2009/05/23 12:35:28| Configuring rea.acmeconsulting.loc Parent
  rea.acmeconsulting.loc/13/3130
 
  Very odd 
 
  Debugging the code, I have found where is situated the problem.
 
  The following if GetService() from cache_cf.c:
 
  static u_short
  GetService(const char *proto)
  {
     struct servent *port = NULL;
     char *token = strtok(NULL, w_space);
     if (token == NULL) {
         self_destruct();
         return -1;              /* NEVER REACHED */
     }
     port = getservbyname(token, proto);
     if (port != NULL) {
         return ntohs((u_short) port-s_port);
     }
     return xatos(token);
  }
 
  When the value of port-s_port is 3328, ntohs() always returns 13.
  Other values seems to work fine.
 
  Any idea ?
 
  Regards
 
  Guido
 
 
 
  -
  
  Guido Serassio
  Acme Consulting S.r.l. - Microsoft Certified Partner
  Via Lucia Savarino, 1           10098 - Rivoli (TO) - ITALY
  Tel. : +39.011.9530135  Fax. : +39.011.9781115
  Email: guido.seras...@acmeconsulting.it
  WWW: http://www.acmeconsulting.it/
 
 


 -
 
 Guido Serassio
 Acme Consulting S.r.l. - Microsoft Certified Partner
 Via Lucia Savarino, 1           10098 - Rivoli (TO) - ITALY
 Tel. : +39.011.9530135  Fax. : +39.011.9781115
 Email: guido.seras...@acmeconsulting.it
 WWW: http://www.acmeconsulting.it/




Re: [squid-users] Error making squid-3.1.0.7-20090412 on Mac OS X 10.4

2009-05-24 Thread vollkommen
I was using my 3.0 squid.conf, slightly tweaked to suit 3.1, when I encountered 
those three issues. I did later try the 3.1 default, again with slight tweaks, 
as seen below. The DNS lookup issue persisted with that route:

diff squid.conf.default squid.conf
2,3c2,3
 acl localhost src 127.0.0.1/32
 acl to_localhost dst 127.0.0.0/8
---
 acl localhost src 127.0.0.1/32 ::1
 acl to_localhost dst 127.0.0.0/8 ::1
22a23
 http_access allow localhost
25c26
 http_port 3128
---
 http_port 3129
27c28,31
 coredump_dir /usr/local/squid31/var/cache
---
 coredump_dir /Applications/squid
 cache_access_log /Applications/squid/logs/access.log
 cache_log /Applications/squid/logs/cache.log
 cache_store_log none
31a36
 debug_options ALL,1 0,5 78,9

In addition, I've also tried replacing the ISC BIND daemon listening on 
localhost:53 with the 6to4-tranlating totd, or have squid 3.1 cache-peering 
with Polipo, all to no avail.

 Original-Nachricht  
 Sorry I didn't get to this a few days ago.
 
 Are you using the default squid.conf that gets built with 3.1 or an 
 altered version?
 Problem #3 will show up for some settings even though there is not yet 
 any other way to do them than netmasks. So it needs to be looked at but 
 in some cases can be ignored.
 
 Problem #1, I'm still thinking about.
 
 Amos
 -- 
 Please be using
Current Stable Squid 2.7.STABLE6 or 3.0.STABLE15
Current Beta Squid 3.1.0.8 or 3.0.STABLE16-RC1

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss 
für nur 17,95 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02