Re: [squid-users] How to determine if URL in HttpRequest is an Ip address

From: Eliezer Croitoru <eliezer_at_ngtech.co.il>
Date: Wed, 16 Oct 2013 10:23:47 +0300

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
Received on Wed Oct 16 2013 - 07:23:59 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 16 2013 - 12:00:05 MDT