From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6987 invoked by alias); 2 Sep 2011 09:54:08 -0000 Received: (qmail 6339 invoked by uid 22791); 2 Sep 2011 09:53:46 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Fri, 02 Sep 2011 09:53:31 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id E25AF2CB465; Fri, 2 Sep 2011 11:53:28 +0200 (CEST) Date: Fri, 02 Sep 2011 09:54:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Different error on socket while connecting to a box behind firewall Message-ID: <20110902095328.GD22172@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-09/txt/msg00021.txt.bz2 On Sep 2 10:16, Jaswinder Bhamra wrote: > Since RedHat machine is behind a firewall (defined by the rules in > 'Linux Firewall.txt') I am expecting my program to give "No route to > host" error (shown in cyggso.out-1.5.24-2.txt file) and not "Operation > not permitted" (shown in cyggso.out-1.7.7-1.txt file). > > If anyone has encountered this issue and know the solution, can you > please share with me. > Not sure if it's an issue between Cygwin versions though. If it is, do > we have any fix for this? Not yet, but the fix will be in the next Cygwin release. The problem is that the conversion from a Winsock error to the corresponding POSIX error code is accidentally called twice in the getsockopt(SO_ERROR) case. However, even with this fix, you might not get EHOSTUNREACH either. In my testing, the error returned by the underlying Winsock getsockopt function is not WSAEHOSTUNREACH, but WSAETIMEDOUT. This will be translated into ETIMEDOUT == "Connection timed out". Thanks for the testcase! Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple