Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 60531B5DBDE for ; Fri, 17 Jun 2011 23:56:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 65060-08 for ; Sat, 18 Jun 2011 02:56:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from morework.geizhals.at (morework.geizhals.at [78.142.138.3]) by mail.postgresql.org (Postfix) with ESMTP id 40625B5DBDD for ; Fri, 17 Jun 2011 23:56:13 -0300 (ADT) Received: from localhost (morework [127.0.0.1]) by morework.geizhals.at (Postfix) with ESMTP id 92DBB1248287; Sat, 18 Jun 2011 04:56:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at geizhals.at Received: from morework.geizhals.at ([127.0.0.1]) by localhost (morework.geizhals.at [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RxB7kOZ-WPhy; Sat, 18 Jun 2011 04:56:07 +0200 (CEST) Received: from klump-pc.ghoffice (mjyrouter [213.235.209.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mjy) by morework.geizhals.at (Postfix) with ESMTPSA; Sat, 18 Jun 2011 04:56:07 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "Tom Lane" Cc: "PostgreSQL Bugs" Subject: Re: Ident authentication fails due to bind error on server (8.4.8) References: <17691.1308325281@sss.pgh.pa.us> <20339.1308333119@sss.pgh.pa.us> Date: Sat, 18 Jun 2011 04:55:59 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Marinos Yannikos" Organization: Preisvergleich Internet Services AG Message-ID: In-Reply-To: <20339.1308333119@sss.pgh.pa.us> User-Agent: Opera Mail/11.11 (Win32) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/160 X-Sequence-Number: 30539 On Fri, 17 Jun 2011 19:51:59 +0200, Tom Lane wrote: > I looked at the glibc source code for getaddrinfo, and it looks like > they do reliably set sin_port to zero when no service argument is > provided, despite the above documentation statement. So that's why it > works for me. But still, if you're on a non-Linux platform it seems > possible that this is the mechanism for what's biting you. Both client and server are Linux systems here and sin_port is 0 also according to debug output I added. I cannot reproduce the problem reliably (the users are much better testers it seems), so I'm a bit stuck with my best guess being TIME_WAIT issues, perhaps FIN packets getting lost. I've set sysctl -w net.ipv4.tcp_tw_reuse=1 now and will post again if there is any change. > (BTW, is it really sane to be using ident auth over a "high latency > connection"? That would certainly suggest to me that you could be > getting connections from untrustworthy machines ...) Both endpoints are properly firewalled (the sane sysadmins say so) and for this particular connection only one client IP address is allowed by pg_hba.conf, the reason why we also use ident authentication is to allow only a few select uid's on the client host to connect to certain DSNs. Thanks for all the helpful info! Regards, Marinos