Bug at getsockopt when TCP_NODELAY is used as parameter

Corinna Vinschen corinna-cygwin@cygwin.com
Mon May 5 15:28:00 GMT 2014


On May  5 14:34, Corinna Vinschen wrote:
> Only, starting with Windows Vista, getsockopt suddenly returned with
> optlen set to 1, which is sizeof(BOOLEAN), the boolean type used by the
> underlying kernel.  And this has never been fixed again.
> 
> Cygwin already handles this problem by converting the value to a
> sizeof(int) value and changing optlen accordingly, but only for the
> socket options SOL_SOCKET/SO_KEEPALIVE and SOL_SOCKET/SO_DONTROUTE.
> 
> I will fix that at one point, but I have to dig into that a bit more to
> see which socket options have to be special-cased, or if this
> special-casing can be radically simplified somehow.  Special-casing
> dozens of socket options just to tweak the return type isn't exactly
> fun.

Funny enough, of all BSD/Linux-compatible options, only three seem to be
affected at all, SOL_SOCKET/SO_KEEPALIVE, SOL_SOCKET/SO_DONTROUTE, and
IPPROTO_TCP/TCP_NODELAY.  I applied a patch which is supposed to fix
this problem, and I just generated a new developer snapshot which is,
as usual, available on http://cygwin.com/snapshots/ Please give it a try.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140505/7ae1bba3/attachment.sig>


More information about the Cygwin mailing list