SOCK_DGRAM and listen() do not mix as reported in
Petter Reinholdtsen [Sun, 1 Oct 2000 10:57:20 +0000 (18:57 +0800)]
Subject: [ID 20000930.001] Bug in perl 5.00503 IO::Socket
Message-Id: <200010010257.KAA05735@localhost.localdomain>

The patch for 5.7.0+ had to be reengineered, though.

p4raw-id: //depot/perl@7113

ext/IO/lib/IO/Socket/UNIX.pm

index d083f48..2a11752 100644 (file)
@@ -37,7 +37,7 @@ sub configure {
        $sock->bind($addr) or
            return undef;
     }
-    if(exists $arg->{Listen}) {
+    if(exists $arg->{Listen} && $type != SOCK_DGRAM) {
        $sock->listen($arg->{Listen} || 5) or
            return undef;
     }