Bug#659075: [rt.cpan.org #61577] ->sockdomain and ->socktype undefined on newly ->accept'ed sockets

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Feb 17 00:22:05 UTC 2012


On Thu, 16 Feb 2012 00:18:03 -0500, Daniel Kahn Gillmor <dkg at fifthhorseman.net> wrote:
> I'm attaching a revised, simplified patch that doesn't make this
> non-portable assumption.  On a Debian GNU/Linux wheezy (testing) system
> right now, it still passes all tests.

Sigh.  I tried the -v3 patch on a FreeBSD system (which doesn't have
SO_PROTOCOL defined, apparently), and on such a system, the tests fail
hard (perl process terminates with return code 29) with the following
message:

   Your vendor has not defined Socket macro SO_PROTOCOL, used at
   /usr/lib/perl/5.14/IO/Socket.pm line 359

This is bad, and probably worse than just returning undefined as it has
up til now.

The attached patch (v4) should behave no worse than the existing
misbehavior on systems where SO_PROTOCOL (or SO_TYPE) is not defined by
the OS, while still re-populating missing cached data on operating
systems that do provide these sockopts.

Regards,

        --dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: robustly-refresh-missing-cached-socket-details-v4.patch
Type: text/x-diff
Size: 950 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/perl-maintainers/attachments/20120216/8fd2ef7c/attachment.patch>


More information about the Perl-maintainers mailing list