Different error on socket while connecting to a box behind firewall

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Sep 2 09:54:00 GMT 2011

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 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

More information about the Cygwin mailing list