You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spot.apache.org by Castille Epee <ca...@gmail.com> on 2017/09/28 19:23:52 UTC

Bug in get_ip_geo_localization

Folks,

A couple of issues in how geoloc lookup is being done.

a) There is an assumption that the iploc.csv is in sorted ascending order.
b) The bisect.bisect method used (even if the iploc.csv was sorted) would
only work if the iploc had no discontinuities, there is no check after
bisect call to see if the actual IP being looked up existed in the range.
It should have checked for the IP falling in the range before returning it.

Before we gen up a patch, could someone confirm if the above analysis is
correct?

We have created some scripts to create a iploc.csv file from public sources
(- domain / owner information). If there is any interest drop me note.

Re: Bug in get_ip_geo_localization

Posted by "Leda G. Lima" <le...@apache.org>.
Hi

You are right in your appreciations.

The code was developed to work with that specific file version, which is
definitely not free.
The best approach would be to consider different file schemas, dynamic
columns and unordered data.

Regards

Gabriela Lima


2017-09-28 14:23 GMT-05:00 Castille Epee <ca...@gmail.com>:

> Folks,
>
> A couple of issues in how geoloc lookup is being done.
>
> a) There is an assumption that the iploc.csv is in sorted ascending order.
> b) The bisect.bisect method used (even if the iploc.csv was sorted) would
> only work if the iploc had no discontinuities, there is no check after
> bisect call to see if the actual IP being looked up existed in the range.
> It should have checked for the IP falling in the range before returning it.
>
> Before we gen up a patch, could someone confirm if the above analysis is
> correct?
>
> We have created some scripts to create a iploc.csv file from public sources
> (- domain / owner information). If there is any interest drop me note.
>