X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Fri, 2 Sep 2011 11:53:28 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Different error on socket while connecting to a box behind firewall Message-ID: <20110902095328.GD22172@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT 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 AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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