From owner-freebsd-net@FreeBSD.ORG Wed Aug 11 06:30:55 2010 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 3DDAD106568D for ; Wed, 11 Aug 2010 06:30:55 +0000 (UTC) (envelope-from Michael.Tuexen@lurchi.franken.de) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 047AF8FC1C for ; Wed, 11 Aug 2010 06:30:53 +0000 (UTC) Received: from [192.168.1.195] (p508FFD25.dip.t-dialin.net [80.143.253.37]) (Authenticated sender: micmac) by mail-n.franken.de (Postfix) with ESMTP id 6AD9B1C0B462B; Wed, 11 Aug 2010 08:30:51 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Michael Tuexen In-Reply-To: <4C61FF94.2090801@nict.go.jp> Date: Wed, 11 Aug 2010 08:30:50 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <7EBDF546-F92F-405A-BFEF-07A28EACA6DF@lurchi.franken.de> References: <4C61FF94.2090801@nict.go.jp> To: Sebastien Decugis X-Mailer: Apple Mail (2.1081) Cc: freebsd-net@freebsd.org Subject: Re: FreeBSD SCTP support? 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: Wed, 11 Aug 2010 06:30:55 -0000 On Aug 11, 2010, at 3:40 AM, Sebastien Decugis wrote: > Hello, >=20 > I am encountering a problem with SCTP stack in FreeBSD 8.1 release (on > amd64); and I am looking for the correct place to report a bug. Would > someone from this list be kind enough to give me direction where I > should report the problem? I am totally new to FreeBSD and I was not > able to find a better place than this mailing-list so far... Reporting it here is the correct place. >=20 > If by any change this list is the correct place, you can find the > description of the problem and steps to reproduce here: > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D149488 It was reported here yesterday and I responded already... >=20 > As I understand the answer in that bug report, SCTP is not part of > FreeBSD? But I did not install anything special, nor could find a > dedicated place on the Internet so far... SCTP is part of FreeBSD. But the point is that your problem is not related to a bug in FreeBSD but in your application. If you use /* Send a message on a socket and a particular stream */ void send_on_stream(int sock, unsigned int strid, unsigned char * msg, = size_t sz) { struct msghdr mhdr; struct iovec iov; struct cmsghdr *cmsg; struct sctp_sndrcvinfo *info; char buffer[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]; ssize_t ret; =09 memset(&mhdr, 0, sizeof(mhdr)); memset(&iov, 0, sizeof(iov)); memset(buffer, 0, CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))); =09 /* IO Vector: message data */ iov.iov_base =3D msg; iov.iov_len =3D sz; =09 /* Anciliary data: specify SCTP stream */ cmsg =3D (struct cmsghdr *)buffer; cmsg->cmsg_level =3D IPPROTO_SCTP; cmsg->cmsg_type =3D SCTP_SNDRCV; cmsg->cmsg_len =3D CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); info =3D (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); info->sinfo_stream =3D strid; mhdr.msg_iov =3D &iov; mhdr.msg_iovlen =3D 1; mhdr.msg_control =3D buffer; mhdr.msg_controllen =3D cmsg->cmsg_len; if ( (ret =3D sendmsg(sock, &mhdr, 0)) < 0) { perror("sendmsg"); exit (1); } ASSERT( ret =3D=3D sz ); /* There should not be partial delivery = with sendmsg... */ =09 return; } the problem is solved. You were not using the CMSG stuff correctly, so = on 64-bit platforms the problem showed up. I hope this helps, if not, feel free to ask any question or contact me = directly. BTW: Do you have a running implementation of RFC 3436 which supports = multiple streams? Best regards Michael >=20 > Thank you! > Best regards, > Sebastien. >=20 > --=20 > Sebastien Decugis > Research fellow > Network Architecture Group > NICT (nict.go.jp) >=20 > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >=20