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 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: <20120521111617 DOT GG7763 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 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 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