Bug 17948 - IO::Socket::UNIX fails for SOCK_DGRAM sockets
Summary: IO::Socket::UNIX fails for SOCK_DGRAM sockets
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: perl
Version: 6.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Chip Turner
QA Contact:
Whiteboard: triage|leonardjo|closed|currentrelease
Depends On:
TreeView+ depends on / blocked
Reported: 2000-09-30 12:02 UTC by pere
Modified: 2007-04-18 16:28 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2004-04-22 15:34:41 UTC

Attachments (Terms of Use)

Description pere 2000-09-30 12:02:23 UTC
There is a bug in /usr/lib/perl5/5.00503/i386-linux/IO/Select.pm in
the perl-5.00503-12 RPM.  It is impossible to make a SOCK_DGRAM server
using UNIX Domain Sockets.  The bug is in configure which calls listen()
for SOCK_DGRAM sockets, even if this call only works for SOCK_STREAM
and SOCK_SEQPACKET sockets.  The following patch should fix the problem.
It is already sent to the author, Graham Barr.

--- IO/Socket.pm.orig Sat Sep 30 19:12:56 2000
+++ IO/Socket.pm      Sat Sep 30 19:14:01 2000
@@ -685,8 +685,10 @@
            return undef;
     if(exists $arg->{Listen}) {
-       $fh->listen($arg->{Listen} || 5) or
-           return undef;
+        if ($type == SOCK_STREAM || $type == SOCK_SEQPACKET) {
+           $fh->listen($arg->{Listen} || 5) or
+               return undef;
+        }
     elsif(exists $arg->{Peer}) {
        my $addr = sockaddr_un($arg->{Peer});

With this patch I was able to get my perl implementatio of syslogd to

Comment 1 Cristian Gafton 2000-10-17 23:38:42 UTC
assigned to nalin

Comment 2 Cristian Gafton 2000-10-18 16:17:11 UTC
assigned to nalin

Comment 3 Chip Turner 2002-05-13 17:59:10 UTC
is this still an issue in the latest red hat release, 7.3?

Comment 4 Petter Reinholdtsen 2002-05-13 18:12:36 UTC
I've moved to Debian since I submitted this bug report.  I do not know if it
is a problem on newer RH-versions.

I should have included test code with the bug report.  I've since changed
location, and do not have access to the problematic program anymore.

Comment 5 Leonard den Ottolander 2004-04-22 15:34:41 UTC
This code has been somewhat rearranged, but since for FC 1
/usr/lib/perl5/5.8.3/IO/Socket/UNIX.pm lines 39-46 now read

	    return undef;
    if(exists $arg->{Listen} && $type != SOCK_DGRAM) {
	$sock->listen($arg->{Listen} || 5) or
	    return undef;
    elsif(exists $arg->{Peer}) {
	my $addr = sockaddr_un($arg->{Peer});

it looks like the test suggested above has been implemented.


Note You need to log in before you can comment on or make changes to this bug.