sockets - sctp_bindx (Solaris sctp library) always return "Invalid argument" -


i writing sctp test program in solaris os, , use solaris native sctp stack. program likes this:

if ((fd = socket(af_inet, sock_seqpacket, ipproto_sctp)) < 0) {     perror("socket"); }   addr.sin_family = af_inet; addr.sin_port = htons(9004); addr.sin_addr.s_addr = inet_addr("192.168.23.117"); if (sctp_bindx(fd, (struct sockaddr*)&addr, sizeof(struct sockaddr_in), sctp_bindx_add_addr) < 0) {     perror("bind"); }   

when running program, return error:"invalid argument". have used gdb check, , find addr structure right.
because solaris isn't open source, can check assembly code using gdb, , find sctp_bindx calls setsockopt function, , setsockopt function return error. calling setsockopt likes this:

setsockopt(fd, sol_sctp, sctp_add_addr, addrs, addrs_size);   

i have checked parameters, , find right. can't figure out cause of issue. me? in advance!

you need call bind first.

from oracle docs on sctp_bindx

an application can use sctp_bindx(sctp_bindx_add_addr) associate  additional addresses endpoint **after calling bind() function**. 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -