From owner-freebsd-net@FreeBSD.ORG Wed Dec 15 08:13:33 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 87DC51065670 for ; Wed, 15 Dec 2010 08:13:33 +0000 (UTC) (envelope-from blade_ly@yahoo.com.cn) Received: from web15007.mail.cnb.yahoo.com (web15007.mail.cnb.yahoo.com [202.165.103.64]) by mx1.freebsd.org (Postfix) with SMTP id A09CA8FC13 for ; Wed, 15 Dec 2010 08:13:32 +0000 (UTC) Received: (qmail 17361 invoked by uid 60001); 15 Dec 2010 07:46:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.cn; s=s1024; t=1292399210; bh=0tKR/Q+4hNlVajf1u/qrTIAMZrF46Xj9vHp+dMcemo4=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=sl47OlmqX/HJ+Q78P08a261cwxFCtInEAUSf4avwQLnvMFov+4MTvYVGiK6wHxKkI7m+6Lfcd79IgDNBGMHN1NMSUR8HkhsAwRKniBEML6L6C9f5p3cw0HrG92fKBQp0TF1BY7/qP7wM8EBp2acwB1ctTawsnJHuPdI2chLQHMg= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.cn; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=6qaEr2dT7AymU5f2VOHCgsJesghgkFxRq4q5/XFqtg6U7XXKXpuL8BfuQlR7x8NSEWt+6oKZMXR9KQikBTUzXnTm9jzfGpq+9uOv3KTvydQVHKU7dtYuXpigX87TeWuDBqxznzc7fBjkOeFuxLVoCqR5io5qu8D4ZSVcC/dUw+c=; Message-ID: <173127.17301.qm@web15007.mail.cnb.yahoo.com> X-YMail-OSG: YQJGdqwVM1ldhALl2Ka5YyIqMtlaxQnrrBU0TH4KFHlFLjp eglFsBDph Received: from [147.243.236.148] by web15007.mail.cnb.yahoo.com via HTTP; Wed, 15 Dec 2010 15:46:49 CST X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.107.285259 Date: Wed, 15 Dec 2010 15:46:49 +0800 (CST) From: =?utf-8?B?572X6ZKw?= To: freebsd-net@freebsd.org In-Reply-To: <20101213120030.B1727106577A@hub.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: [SCTP] last_sequence_delivered in sctp_process_a_data_chunk question 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, 15 Dec 2010 08:13:33 -0000 Hi, all experts:=C2=A0=C2=A0 =C2=A0I find a suspect point in function of=C2= =A0sctp_process_a_data_chunk in all FreeBSD branches.for example:Line 1900 = of sctp_indata:=C2=A0(asoc->strmin[strmno].last_sequence_delivered + 1) =3D= =3D strmseqThis is a logical judgement sentence.last_sequence_delivered=C2= =A0is unsigned short type, strmseq is also.there is a problem:=C2=A0if=C2= =A0last_sequence_delivered equal 0xffff, and the result of=C2=A0last_sequen= ce_delivered + 1 must be 0x10000, rather than 0x0000, and if=C2=A0strmseq i= s also be 0x0, then this judgement will give you wrong value. so i think =C2=A0put a (uint16_t) before this sentence will be more secure.= so how do you think?like this: (uint16_t)(asoc->strmin[strmno].last_sequen= ce_delivered + 1) =3D=3D strmseqThanks and i hope your response.=0A=0A=0A =