This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in package: nc6-1.0-1


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]