Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Dec 2011 19:10:46 -0800 (PST)
From:      jyl_2006 <yilinjing2006@gmail.com>
To:        freebsd-net@freebsd.org
Subject:   Re: the return value of sctp_connectx do not match any error
Message-ID:  <1323054646502-5047743.post@n5.nabble.com>
In-Reply-To: <F2E9EABF-175E-418C-8E52-0DDF4BF483F0@lurchi.franken.de>
References:  <1322919283456-5044536.post@n5.nabble.com> <76108404-D722-48D0-AAAA-F35B77F5CFCF@lurchi.franken.de> <1322966561294-5045598.post@n5.nabble.com> <F9593CD9-520A-49D4-9093-7DA02DDEE521@lurchi.franken.de> <1323000072198-5046113.post@n5.nabble.com> <ED9B11CB-4442-44C2-86EC-A2F7AC86C8E4@lurchi.franken.de> <1323001847851-5046165.post@n5.nabble.com> <3E25BC69-1FC8-487E-BBAD-8BAF2552623B@lurchi.franken.de> <1323004488998-5046216.post@n5.nabble.com> <F2E9EABF-175E-418C-8E52-0DDF4BF483F0@lurchi.franken.de>

next in thread | previous in thread | raw e-mail | index | archive | help
This time, the program you provide work perfectly.
But when I use another program to test, the result
is"SCTP_GET_LOCAL_ADDRESS:no such file or directory".

/*My own program have the same set with the program you provide, that means
the ip address is the same and both programs have same "Server to be
connected" .
The "siz" refered in the following code is different with the value I get
from my another program*/

 if (getsockopt(_sctp_socket, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, addrs,
&siz) != 0) { 
        perror("SCTP_GET_LOCAL_ADDRESSES"); 
        return (-1); 
 } 
        printf("siz = %u.\n", siz);

As far as I know, then getsockopt is fail, the return value is -1, and the
errno is set as one of following values 1.EBADF, 2.ENOTSOCK, 3.ENOPROTOOPT
4.EFAULT, 5.EINVAL . In my own program I use return_value =
getsockopt(_sctp_socket, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, addrs,
&siz), the value of return_value is -1, so it means an error happened and
errno will be set. A strange thing happens, the errno is not the values
refered above.

Thanks.

--
View this message in context: http://freebsd.1045724.n5.nabble.com/the-return-value-of-sctp-connectx-do-not-match-any-error-tp5041952p5047743.html
Sent from the freebsd-net mailing list archive at Nabble.com.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1323054646502-5047743.post>