Jump to content

Invalid IP addresses returned


kickstart

Recommended Posts

Hi

 

I have a couple of phpbb forums on my web space.

 

One is randomly throwing people off and it is getting far worse.

 

I have traced down the issue to the IP address. Phpbb stores the IP address and session id and checks that they match. If not it throws the user out. The session ids seem to be there OK, but the IP addresses aren't.

 

When it causes a problem the IP address seems to be returned as "::" (yes, 2 colons).

 

I have used the following routine to try and obtain a relevant IP address and it to returns "::"

 

function getRealIpAddr()
{
    if (!empty($_SERVER['HTTP_CLIENT_IP']))   //check ip from share internet
    {
      $ip=$_SERVER['HTTP_CLIENT_IP'];
    }
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))   //to check ip is pass from proxy
    {
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    else
    {
      $ip=$_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}

 

Any ideas?

 

All the best

 

Keith

Link to comment
Share on other sites

I would suggest that these clients returning :: are using ipv6 instead of the more traditional ipv4.

 

My advice would be to report this as a bug to phpBB.

 

IPv6 is my guess as well, but surely that should be returned in the server variables. I don't care too much what it is as long as it is consistent.

 

Unfortunately it is an old phpBB2 board so no longer supported.

 

All the best

 

Keith

Link to comment
Share on other sites

Hi

 

I have done a small mod to log the IP address of every visit.

 

Looking at that there is no pattern. If I visit a dozen times in a row, I might land up with 2/3 being recorded as "::" and 1/3 being my real IP address, or it might record them all fine.

 

I have another similar board on the same hosting account and that doesn't seem to have the same problem at all.

 

All the best

 

Keith

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.