Add explict filtering valid IP addresses.

By filtering out bad IPs earlier you get the added performance of
not needing to hit the geoip database. Also frees you up from
GeoIP fallback
Merge branch 'add_explicit_ip_filtering'