delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/05/21/10:40:03

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 21 May 2012 16:38:49 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Bug in package: nc6-1.0-1
Message-ID: <20120521143849.GI7763@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <announce DOT 20120507194531 DOT GL18516 AT calimero DOT vinschen DOT de> <joua67$nrh$1 AT dough DOT gmane DOT org> <20120521111617 DOT GG7763 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20120521111617.GG7763@calimero.vinschen.de>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 May 21 13:16, Corinna Vinschen wrote:
> On May 15 14:18, René Berber wrote:
> > On 5/7/2012 2:45 PM, Corinna Vinschen wrote:
> > 
> > >I've just uploaded a new package called nc6-1.0-1.
> > 
> > Hi,
> > 
> > nc6 doesn't handle UDP at all, for instance after receiving the
> > first message (from another nc6 process as client):
> > 
> > $ nc6 -4lup 7000
> > nc6: connect failed on datagram socket: Address family not supported
> > by protocol
> > 
> > The other netcat, nc 1.107-3 doesn't have the problem.
> > 
> > Both seem to handle IPv6 (untested, only looking at the parameters).
> 
> Thanks for the report.  I'll have a look.

Surprise, surprise, this is apparently Cygwin itself misbehaving.
There's long standing code (last change: 2002) in recv, recvfrom, and
recvmsg, which returns prematurely if the buflen argument is 0.

That makes *some* sense, given that Windows doesn't handle a 0 bytes
buffer gracefully.  It returns with an error WSAEMSGSIZE while a POSIX
system is supposed to return 0.

For recv, that's more or less ok, but for recvfrom and recvmsg the
downside of this shortcut is, that the "from" and "fromlen" arguments
are not set correctly on return.  This is what nc6 stumbles over.
Talking about recv: Even for recv the problem is that connection errors
are not recognized if we take the shortcut.  So it's not good at all.
Above all, WSAEMSGSIZE is already handled anyway...

I'll check in a fix to Cygwin shortly.  Please give the next developer
snapshot a try.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019