[PATCH] Add IPv6 support to GeoIP module
Maxim Dounin
mdounin at mdounin.ru
Wed Oct 5 12:52:10 UTC 2011
Hello!
On Wed, Oct 05, 2011 at 01:56:35PM +0200, Bruno Prémont wrote:
> Hallo,
>
> 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
> > commit):
> >
> > http://mailman.nginx.org/pipermail/nginx-devel/2011-June/000971.html
> >
> > 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
> same features.
>
>
> If IPv6 database once stops including knowledge about IPv4 addresses
> lookup would start failing (but that hopefully would only happen when
> IPv4 gets irrelevant).
IPv6 database can't really drop ipv4 mapped addresses, as it's just
part of ipv6 address space and may appear even if you aren't using
ipv4 at all. (This isn't really good for security reasons, but
that's completely different story.)
So you are happy with Gregor's patch, right? Let's focus on it
then.
Maxim Dounin
More information about the nginx
mailing list