Please do not reply directly to this email. All additional comments should be made in the comments box of this bug report.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=207838
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@redhat.com ReportedBy: pablo_p@op.pl QAContact: dkl@redhat.com CC: fedora-perl-devel-list@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 this:
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): perl-5.8.8-5 glibc-2.4-11 kernel-2.6.17-1.2187_FC5
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.
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
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=207838
bugzilla@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |medium Priority|normal |medium
------- Additional Comments From nhorman@redhat.com 2007-06-11 10:42 EST ------- This seems like a kernel bug to me. We're checking all our getsockopt values for != sizeof(option) rather than for < sizeof(option), and we should be returning ENOBUFS, rather than EINVAL (or silently truncating the result as POSIX indicates).
perl-devel@lists.fedoraproject.org