From owner-freebsd-net@FreeBSD.ORG Mon Dec 5 03:10:47 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A85571065746 for ; Mon, 5 Dec 2011 03:10:47 +0000 (UTC) (envelope-from yilinjing2006@gmail.com) Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC5C8FC1D for ; Mon, 5 Dec 2011 03:10:47 +0000 (UTC) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RXOx4-0007qD-HN for freebsd-net@freebsd.org; Sun, 04 Dec 2011 19:10:46 -0800 Date: Sun, 4 Dec 2011 19:10:46 -0800 (PST) From: jyl_2006 To: freebsd-net@freebsd.org Message-ID: <1323054646502-5047743.post@n5.nabble.com> In-Reply-To: References: <1322919283456-5044536.post@n5.nabble.com> <76108404-D722-48D0-AAAA-F35B77F5CFCF@lurchi.franken.de> <1322966561294-5045598.post@n5.nabble.com> <1323000072198-5046113.post@n5.nabble.com> <1323001847851-5046165.post@n5.nabble.com> <3E25BC69-1FC8-487E-BBAD-8BAF2552623B@lurchi.franken.de> <1323004488998-5046216.post@n5.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: the return value of sctp_connectx do not match any error X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 03:10:47 -0000 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.