Geo IP function fix, for IPv4 and IPv6. Fixes #1482