[PATCH] Add IPv6 support to GeoIP module
bruno.premont at restena.lu
Wed Oct 5 11:56:35 UTC 2011
On Wed, 5 Oct 2011 15:05:28 Maxim Dounin <mdounin at mdounin.ru> wrote:
> On Tue, Oct 04, 2011 at 09:22:31AM +0200, Bruno Prémont wrote:
> > geoip module currently only supports a single country and a single city
> > MaxMind database that must cover IPv4 address range.
> > Below patch allows setting up to two city and country databases, one
> > for IPv4 and one for IPv6. It then looks-up the requesting IP address in
> > the appropriate database.
> > Please review and consider applying,
> Please take a look at this patch instead (this one is sitting in
> my TODO queue, waiting for more thoughtfull review and likely
> Do you have any problems with Gregor Kališnik's patch?
I didn't stumble on Gregor's patch before writing mine and your
reference made me aware of it.
> How your patch is different?
The difference between both patches is that mine accepts to load two
databases, one for IPv4 and one for IPv6.
From a short test with geoiplookup6 it seems that MaxMind's IPv6 country
database includes the IPv4 database and thus can answer for mapped IPv4
addresses (which I didn't know).
So as long as that remains true Gregor's patch looks more simple (while
covering feature-test of geoip lib which mine doesn't) and provides the
If IPv6 database once stops including knowledge about IPv4 addresses
lookup would start failing (but that hopefully would only happen when
IPv4 gets irrelevant).
More information about the nginx