X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7FF3656457 for ; Mon, 7 Mar 2005 17:46:36 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49525-09 for ; Mon, 7 Mar 2005 17:46:34 +0000 (GMT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3EDB656454 for ; Mon, 7 Mar 2005 17:46:33 +0000 (GMT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1D8MCi-0002ji-Px for pgsql-jdbc@postgresql.org; Mon, 07 Mar 2005 18:39:41 +0100 Received: from c-24-0-215-239.client.comcast.net ([24.0.215.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Mar 2005 18:39:40 +0100 Received: from i.pilcher by c-24-0-215-239.client.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Mar 2005 18:39:40 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Ian Pilcher Subject: Re: ident auth postgres 7.4 fedora core 3 Date: Mon, 07 Mar 2005 11:43:02 -0600 Lines: 38 Message-ID: References: <20050307062838.11055.qmail@web30307.mail.mud.yahoo.com> <2491.1110213167@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: c-24-0-215-239.client.comcast.net User-Agent: Mozilla Thunderbird 0.9 (X11/20041127) X-Accept-Language: en-us, en In-Reply-To: <2491.1110213167@sss.pgh.pa.us> X-Gmane-MailScanner: Found to be clean X-Gmane-MailScanner: Found to be clean X-Gmane-MailScanner-SpamScore: s X-MailScanner-From: sql-pgsql-jdbc@m.gmane.org X-MailScanner-To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200503/47 X-Sequence-Number: 12440 Tom Lane wrote: > Ian Pilcher 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 ========================================================================