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

Reply via email to