Dear Sirs,
I found some problems using the geoip module. My system is a debian squeeze x86_64; and I installed the following packages:
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Nome Versione Descrizione +++-=============================================-=============================================-========================================================================================================== ii geoip-bin 1.4.7~beta6+dfsg-1 IP lookup command line tools that use the GeoIP library ii geoip-database 1.4.7~beta6+dfsg-1 IP lookup command line tools that use the GeoIP library (country database) ii libgeoip-dev 1.4.7~beta6+dfsg-1 Development files for the GeoIP library ii libgeoip1 1.4.7~beta6+dfsg-1 A non-DNS IP-to-country resolver library
Using /usr/share/GeoIP/GeoIP.dat as database, the geoip_match("$si", "src") function failed with retcode -2 (NULL from GeoIP_record_by_name()). And finally I found the problem with the GeoIP file DB itself. In particular, compiling a mini program for debug, it said:
Invalid database type GeoIP Country Edition, expected GeoIP City Edition, Rev 1
After manually downloading the GeoLiteCity.dat from MaxMind.com everything went fine.
I wrote for letting others know my solution, and for asking you if there is a cleaner way to solve it.
Best regards, Francesco Castellano