SCTP Discussions

Text archives Help


[SCTP-Discussion] Bug in adl_open_sctp_socket() in "adaptation.c"


Chronological Thread 
  • From: "J.W. Chang" <jwjang AT telcoware.com>
  • To: <discussion AT sctp.de>
  • Subject: [SCTP-Discussion] Bug in adl_open_sctp_socket() in "adaptation.c"
  • Date: Fri Nov 2 17:07:00 2001
  • List-id: SCTP Discussions <discussion.sctp.de>
  • Organization: Telcoware, Co. Ltd.

Hello,
 
Currently I'm trying to port sctplib-pre14 to Solaris 2.6.
(It was very hard work since "configure" script of sctplib-pre14 seems to be tuned for
Solaris 7 or 8. Why Solaris 2.6? Please ask my boss. :-))
 
Anyway, I've found a bug from "adaptation.c". Take a look at adl_open_sctp_socket().
There is a local variable "opt_size" in integer type. Its address is passed to getsockopt()
as the last parameter, to retrieve the value of SO_RCVBUF socket option.
Here is the prototype of getsockopt():
 
int  getsockopt(int  s, int level, int optname, void *optval, socklen_t *optlen);
 
According to the man page of getsockopt(), the last optlen is a kind of "value-result"
type of parameter. That is, value of optlen must be initialized as the size of buffer
pointed to by optval. Buf "opt_size" variable in "adaptation.c" is not initialized at all.
While it was no problem on my Linux, it caused problem on my Sun Ultra-10 with Solaris 2.6.
(getsockopt() fails.)
That can be quickly cured by initializing "opt_size" as sizeof(int).
 
Chang Jin-woong
jwjang AT telcoware.com
 
PS: It seems that Sol2.6 does not support RECVDSTADDR socket option. Does anyone
know RECVDSTADDR equivalent on Solaris 2.6/7/8? Thanks in advance.


  • [SCTP-Discussion] Bug in adl_open_sctp_socket() in "adaptation.c", J.W. Chang, 11/02/2001

Archive powered by MHonArc 2.6.19+.

Top of page