Обсуждение: IPv6 connection

Поиск
Список
Период
Сортировка

IPv6 connection

От
Guillaume Lelarge
Дата:
Hi,

pgAdmin 1.10 (and earlier) will throw an error if a user tries to
connect to an IPv6 address (for example ::1, which is IPv6 localhost).

This patch fixes this issue on Linux (and probably Mac). But it just
doesn't compile on Windows. Any ideas on a fix for Windows?

Actually, I'm wondering why we try to resolve the hostname on pgAdmin.
libpq already does this. Can't we just push the string to libpq and let
it resolve the string address? it would be a more simple fix for our issue.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Вложения

Re: IPv6 connection

От
Dave Page
Дата:
On Tue, Jan 12, 2010 at 4:01 AM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:

> Actually, I'm wondering why we try to resolve the hostname on pgAdmin.
> libpq already does this. Can't we just push the string to libpq and let
> it resolve the string address? it would be a more simple fix for our issue.

If memory serves, it's required to get Kerberos to work properly.
Magnus may recall more.


--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Re: IPv6 connection

От
Magnus Hagander
Дата:
On Tue, Jan 12, 2010 at 07:00, Dave Page <dpage@pgadmin.org> wrote:
> On Tue, Jan 12, 2010 at 4:01 AM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>
>> Actually, I'm wondering why we try to resolve the hostname on pgAdmin.
>> libpq already does this. Can't we just push the string to libpq and let
>> it resolve the string address? it would be a more simple fix for our issue.
>
> If memory serves, it's required to get Kerberos to work properly.
> Magnus may recall more.

I think you have that one backwards. Kerberos *requires* the hostname,
it doesn't work if you just supply the IP address.

I have no idea why we do the resolving in pgAdmin, but Kerberos
certainly isn't the reason. Maybe it's some reasoning around being
able to control the error message if it fails?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

Re: IPv6 connection

От
Guillaume Lelarge
Дата:
Le 12/01/2010 10:36, Magnus Hagander a écrit :
> On Tue, Jan 12, 2010 at 07:00, Dave Page <dpage@pgadmin.org> wrote:
>> On Tue, Jan 12, 2010 at 4:01 AM, Guillaume Lelarge
>> <guillaume@lelarge.info> wrote:
>>
>>> Actually, I'm wondering why we try to resolve the hostname on pgAdmin.
>>> libpq already does this. Can't we just push the string to libpq and let
>>> it resolve the string address? it would be a more simple fix for our issue.
>>
>> If memory serves, it's required to get Kerberos to work properly.
>> Magnus may recall more.
>
> I think you have that one backwards. Kerberos *requires* the hostname,
> it doesn't work if you just supply the IP address.
>
> I have no idea why we do the resolving in pgAdmin, but Kerberos
> certainly isn't the reason. Maybe it's some reasoning around being
> able to control the error message if it fails?
>

I deleted the resolving code to check what kind of error I would get.

With the resolving code:

  Could not resolve hostname ip6-localhostaa

Without the resolving code:

  Error connecting to the server: could not translate host name
  "ip6-localhostaa" to address: Name or service not known

They all can be translated, but the first one need a translation on
pgAdmin, and the second one need a translation on PostgreSQL.

Moreover, I tried to find when the resolving code appeared. It seems it
was there since the beginning (2003 IIRC).

I would be much in favor of dropping the code. Probably because I can't
get the Windows code to work :) I tried to add some headers, but to no
avail.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: IPv6 connection

От
Dave Page
Дата:
2010/1/13 Guillaume Lelarge <guillaume@lelarge.info>:
> Moreover, I tried to find when the resolving code appeared. It seems it
> was there since the beginning (2003 IIRC).
>
> I would be much in favor of dropping the code. Probably because I can't
> get the Windows code to work :) I tried to add some headers, but to no
> avail.

Well I don't object if it doesn't break anything. Did the original
commit explain its purpose?

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Re: IPv6 connection

От
Guillaume Lelarge
Дата:
Le 13/01/2010 04:47, Dave Page a écrit :
> Well I don't object if it doesn't break anything. Did the original
> commit explain its purpose?

This is the original commit:

  http://code.pgadmin.org/trac/changeset/767

Was a bit hard to find. I had to see changeset by changeset. Anyways.

The commit message was: "Cleanup and error handling for the connection
code." But I don't see any comments in the code which explains why you
added it in the first place.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: IPv6 connection

От
Dave Page
Дата:
On Wed, Jan 13, 2010 at 1:13 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Le 13/01/2010 04:47, Dave Page a écrit :
>> Well I don't object if it doesn't break anything. Did the original
>> commit explain its purpose?
>
> This is the original commit:
>
>  http://code.pgadmin.org/trac/changeset/767
>
> Was a bit hard to find. I had to see changeset by changeset. Anyways.
>
> The commit message was: "Cleanup and error handling for the connection
> code." But I don't see any comments in the code which explains why you
> added it in the first place.

Hmm, no. I don't recall what it was for either.



--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Re: IPv6 connection

От
Guillaume Lelarge
Дата:
Le 13/01/2010 10:18, Dave Page a écrit :
> On Wed, Jan 13, 2010 at 1:13 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> Le 13/01/2010 04:47, Dave Page a écrit :
>>> Well I don't object if it doesn't break anything. Did the original
>>> commit explain its purpose?
>>
>> This is the original commit:
>>
>>  http://code.pgadmin.org/trac/changeset/767
>>
>> Was a bit hard to find. I had to see changeset by changeset. Anyways.
>>
>> The commit message was: "Cleanup and error handling for the connection
>> code." But I don't see any comments in the code which explains why you
>> added it in the first place.
>
> Hmm, no. I don't recall what it was for either.
>

I don't strictly want to drop this code. If we can find a way to compile
this code on Windows, that would be great. I don't know how to do this
myself. Every webpage I found on this issue turns to "not work for me".
Magnus and you will probably do a better job on this than myself. Do one
of you want to work on this? it doesn't have to be done right now, but I
would like to see it fixed for 1.12.

BTW, I tried to find something like this on wxWidgets. Unfortunately,
wxIPv6Address is in alpha stage, so I don't think we want to use that :)


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: IPv6 connection

От
Dave Page
Дата:
On Wed, Jan 13, 2010 at 11:14 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:

> I don't strictly want to drop this code. If we can find a way to compile
> this code on Windows, that would be great. I don't know how to do this
> myself. Every webpage I found on this issue turns to "not work for me".
> Magnus and you will probably do a better job on this than myself. Do one
> of you want to work on this? it doesn't have to be done right now, but I
> would like to see it fixed for 1.12.

Well if the code has no obvious purpose, and nothing is broken by
removing it, I don't see any reason to leave it there.


--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Re: IPv6 connection

От
Guillaume Lelarge
Дата:
Le 14/01/2010 07:33, Dave Page a écrit :
> On Wed, Jan 13, 2010 at 11:14 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>
>> I don't strictly want to drop this code. If we can find a way to compile
>> this code on Windows, that would be great. I don't know how to do this
>> myself. Every webpage I found on this issue turns to "not work for me".
>> Magnus and you will probably do a better job on this than myself. Do one
>> of you want to work on this? it doesn't have to be done right now, but I
>> would like to see it fixed for 1.12.
>
> Well if the code has no obvious purpose, and nothing is broken by
> removing it, I don't see any reason to leave it there.
>
>

I commited my fix. Not sure if we should consider this a bug (and so
backpatch it on 1.10). I can work on this, but I have the feeling we
won't have a 1.10.2.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com