From: Ian Pilcher <i.pilcher@comcast.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: ident auth postgres 7.4 fedora core 3
Date: Mon, 07 Mar 2005 11:43:02 -0600
Message-ID: <d0i3gl$njf$1@sea.gmane.org> (raw)
In-Reply-To: <2491.1110213167@sss.pgh.pa.us>
References: <20050307062838.11055.qmail@web30307.mail.mud.yahoo.com>
<d0hrsu$q0u$1@sea.gmane.org>
<2491.1110213167@sss.pgh.pa.us>
Tom Lane wrote:
> Ian Pilcher <i.pilcher@comcast.net> writes:
>
>>Since 1.4.2 (I believe), Java uses IPv6 by default. When a connection
>>is made to an IPv4 address, it actually makes an IPv6 connection to an
>>"IPv4-mapped address". So when you request a connection to 127.0.0.1,
>>you actually get a connection to ::ffff:127.0.0.1. PostgreSQL doesn't
>>know this, however; it asks the ident daemon, "who's connecting from
>>127.0.0.1?" The daemon answers "nobody".
>
>
> Hmm. I think you have mischaracterized the situation, because the
> IDENT protocol doesn't actually mention IP addresses at all --- just
> port numbers. It's up to Postgres to connect back to the same IP
> address that the connection came from, and AFAIK we do that correctly
> for IPv6 addresses.
You're right. I believe that what happens is that PostgreSQL, seeing a
client connection from 127.0.0.1, uses an IPv4 socket to connect to the
ident daemon. The daemon sees a request from 127.0.0.1, so it goes
looking for an IPv4 connection (in /proc/net/tcp); it doesn't find it,
because the socket is actually listed in /proc/net/tcp6 (with a local
address of ::ffff:127.0.0.1).
> This report could indicate a bug in our handling of the case, or it
> could indicate a configuration error on the part of the OP, or it could
> be that his ident daemon isn't handling the case correctly. There's
> not enough info to tell. It would be useful to see the postmaster log
> output when the connection is rejected.
Perhaps there's a bug in PostgreSQL's handling of IPv4-mapped sockets,
or perhaps Linux reports it to PostgreSQL as an IPv4 socket ... or
perhaps Red Hat is disabling PostgreSQL's IPv6 support in their RPMs.
--
========================================================================
Ian Pilcher i.pilcher@comcast.net
========================================================================
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: i.pilcher@comcast.net
Subject: Re: ident auth postgres 7.4 fedora core 3
In-Reply-To: <d0i3gl$njf$1@sea.gmane.org>
References: <20050307062838.11055.qmail@web30307.mail.mud.yahoo.com> <d0hrsu$q0u$1@sea.gmane.org> <2491.1110213167@sss.pgh.pa.us> <d0i3gl$njf$1@sea.gmane.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox