From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ian Pilcher <i.pilcher@comcast.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: ident auth postgres 7.4 fedora core 3
Date: Mon, 07 Mar 2005 12:37:30 -0500
Message-ID: <3027.1110217050@sss.pgh.pa.us> (raw)
In-Reply-To: <d0hrsu$q0u$1@sea.gmane.org>
References: <20050307062838.11055.qmail@web30307.mail.mud.yahoo.com>
<d0hrsu$q0u$1@sea.gmane.org>
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".
I traced through this on my own Fedora Core 3 box (kernel
2.6.10-1.766_FC3), and found that when I do
psql -l -h ::ffff:127.0.0.1
the remote address given to Postgres by accept() is actually 127.0.0.1
not ::ffff:127.0.0.1. So the kernel itself is doing the conversion at
some level. On the psql side, the addresses are in fact shown as
::ffff:127.0.0.1, so the dirty work is being done in the kernel, it's
not that glibc downconverted the address to IPv4 in psql userland before
making the connection request. In fact, "lsof" shows the connection as
being IPv6 on the psql side and IPv4 on the postmaster side!
Arguably this is a bug, or at least a bad idea, but there's probably not
going to be much interest in changing the kernel behavior in the near
future. They'll say it would break many more things than it fixes
because of the many non-IPv6-aware programs out there. And I suppose
they'd be right.
If you can't get any results from telling authd to map the addresses,
you might try connecting to "::1" instead of "::ffff:127.0.0.1".
regards, tom lane
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: tgl@sss.pgh.pa.us, i.pilcher@comcast.net
Subject: Re: ident auth postgres 7.4 fedora core 3
In-Reply-To: <3027.1110217050@sss.pgh.pa.us>
References: <20050307062838.11055.qmail@web30307.mail.mud.yahoo.com> <d0hrsu$q0u$1@sea.gmane.org> <3027.1110217050@sss.pgh.pa.us>
* 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