Search squid archive

Re: How to determine if URL in HttpRequest is an Ip address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/16/2013 09:48 AM, Sachin Gupta wrote:
We are using squid 3.1.6 and every time i access a IP Based URL, i get
1 for GetHostIsNumeric(). There is a limitation from client for
upgradation of the release:(
OK understood but..
What is the reason for that?

Eliezer

Searched the net and found that IsAnyAddr() had bugs and Address.cc in
ip was modified.

Applied the patch and modified the functions IsAnyAddr to

bool
Ip::Address::IsAnyAddr() const
{
     return IN6_IS_ADDR_UNSPECIFIED(&m_SocketAddr.sin6_addr) ||
IN6_ARE_ADDR_EQUAL(&m_SocketAddr.sin6_addr, &v4_anyaddr);
}

IsIPv4() to

bool
Ip::Address::IsIPv4() const
{
     return IN6_IS_ADDR_V4MAPPED( &m_SocketAddr.sin6_addr );
}

IsIPv6 to:

bool
Ip::Address::IsIPv6() const
{
     return !IsIPv4();
}

Still i keep on getting 1 for IP Based urls.

Please suggest.

Regards
Sachin





[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux