[Bug 207838] New: Perl getsockopt() on SCTP sockets doesn't work

bugzilla at redhat.com bugzilla at redhat.com
Sun Sep 24 10:35:09 UTC 2006

Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug report.


           Summary: Perl getsockopt() on SCTP sockets doesn't work
           Product: Fedora Core
           Version: fc5
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: normal
         Component: perl
        AssignedTo: rnorwood at redhat.com
        ReportedBy: pablo_p at op.pl
         QAContact: dkl at redhat.com
                CC: fedora-perl-devel-list at redhat.com

Description of problem:

Perl getsockopt() on SCTP socket does not work. Following perl code:
use strict;
use IO::Socket;

## create sctp socket
my $sock = new IO::Socket::INET(
        Proto => 132,
        Type  => SOCK_STREAM
) or die "Cannot create sctp socket";

## read rto data
my $i = getsockopt($sock, 132, 1);

#print rto data
print join("\n", unpack("I i*", $i));

Works on Solaris10, but not on (my) Linux. I checked C getsockopt, and code like

ret  = getsockopt(sock , SOL_SCTP, SCTP_RTOINFO, &sctp_info, &len);

works OK only if len is initially set to sizeof(struct sctp_rtoinfo), which is
not what manual says:
> man getsockopt
       The  parameters  optval and optlen are used to access option values for
       setsockopt().  For getsockopt() they identify a  buffer  in  which  the
       value  for  the  requested  option(s) are to be returned.  For getsock-
       opt(), optlen is a value-result  parameter,  initially  containing  the
       size  of  the  buffer  pointed  to by optval, and modified on return to
       indicate the actual size of the value returned.  If no option value  is
       to be supplied or returned, optval may be NULL.

Above applies to all SCTP structures available via get/setsockopt.

Version-Release number of selected component (if applicable):

How reproducible:
every time

Steps to Reproduce:
1. run perl code from description
2. nothing is displayed
Actual results:
nothing is displayed

Expected results:
sctp socket rto into (4 parameters)

Additional info:
SELinux is disabled.

Configure bugmail: https://bugzilla.redhat.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the Fedora-perl-devel-list mailing list