I noticed that it processes my cron IP, in this case 192.168.17.1. This being a non-public IP is theoretically an invalid look up, not to mention that the 3rd party service might not appreciate getting requests for such IP's. On my web site it takes about 250ms to process the IP.

I'm not sure how to avoid this other than hard coding IP's to ignore so I haven't provided a patch... hoping that someone will come up with a better methodology.

However, for anyone who wants to stop this on their web sites the obvious quick and dirty solution is this at the top of _visitorinfo_get_location():

  if ($ip == 'your local IP') return;

Comments

reg’s picture

I actually did it like this on mine:

  if (preg_match('/^(192|localhost)/i', $ip)) return;
twooten’s picture

Status: Active » Fixed

Fixed in 6.x-1.5. Please let me know if anyone encounters any issue with this.

Thanks,
Tim

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

reg’s picture

Status: Closed (fixed) » Needs work

Hi, I looked at your fix and it certainly does ignore the server IP however if you notice in the final temporary fix that I created, I used a regex. so as to ignore all local addresses on my network. After all, there will be no Geo Info. for any non-public IP addresses either (unless it just comes back as "local" or something but you could do that yourself and save using the network to return info. you already know).

I think to make this technically correct you should test the IP against all IP addresses designated as private (RFC1918, RFC4193) which fortunately is pretty easy, they being for IPV4:

     10.0.0.0        -   10.255.255.255  (10/8 prefix)
     172.16.0.0      -   172.31.255.255  (172.16/12 prefix)
     192.168.0.0     -   192.168.255.255 (192.168/16 prefix)

I'm not sure which are private for IPV6 but here is the RFC that will tell you:
http://tools.ietf.org/html/rfc4193