develooper Front page | perl.perl5.porters | Postings from December 2013

[perl #118843] crash when peerhost called

Thread Previous
From:
Tony Cook via RT
Date:
December 19, 2013 00:00
Subject:
[perl #118843] crash when peerhost called
Message ID:
rt-4.0.18-19326-1387411199-1285.118843-15-0@perl.org
On Thu Jul 11 21:27:20 2013, xyf.xiao@gmail.com wrote:
> Thanks all to reply ! it seems a OS specific issue, The test script
> works fine in both windos and linux platform. I'll do some dig at this
> weekend to find the underlying reason.

It looks like the bug is cygwin (or maybe a limitation of Win32) doesn't update the socklen parameter supplied to recvfrom(), so if you supply a large buffer (as perl does, since it needs to allow for non-IPv4 protocols like UNIX sockets), the whole buffer is returned, not just the struct sockaddr_in part.

As to whether this is a Win32 limitation - the Win32 documentation for both recvfrom() [1] and WSARecvFrom() [2] both indicate that the from/fromlen parameters are ignored for connection oriented sockets.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=118843

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About