From owner-freebsd-net@FreeBSD.ORG Wed Dec 15 09:15:17 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 7CB4B1065672 for ; Wed, 15 Dec 2010 09:15:17 +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 0E8418FC1E for ; Wed, 15 Dec 2010 09:15:17 +0000 (UTC) Received: from [10.0.1.103] (unknown [212.201.121.94]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id E187B1C0B4610; Wed, 15 Dec 2010 10:15:14 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=utf-8 From: =?iso-8859-1?Q?Michael_T=FCxen?= In-Reply-To: <173127.17301.qm@web15007.mail.cnb.yahoo.com> Date: Wed, 15 Dec 2010 10:15:13 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <173127.17301.qm@web15007.mail.cnb.yahoo.com> To: =?utf-8?B?572X6ZKw?= X-Mailer: Apple Mail (2.1082) Cc: freebsd-net@freebsd.org Subject: Re: [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 09:15:17 -0000 On Dec 15, 2010, at 8:46 AM, =E7=BD=97=E9=92=B0 wrote: > Hi, all experts: I find a suspect point in function of = sctp_process_a_data_chunk in all FreeBSD branches.for example:Line 1900 = of sctp_indata: (asoc->strmin[strmno].last_sequence_delivered + 1) =3D=3D = strmseqThis is a logical judgement sentence.last_sequence_delivered is = unsigned short type, strmseq is also.there is a problem: if = last_sequence_delivered equal 0xffff, and the result of = last_sequence_delivered + 1 must be 0x10000, rather than 0x0000, and if = strmseq is also be 0x0, then this judgement will give you wrong value. > so i think put a (uint16_t) before this sentence will be more secure. = so how do you think?like this: = (uint16_t)(asoc->strmin[strmno].last_sequence_delivered + 1) =3D=3D = strmseqThanks and i hope your response. In head and FreeBSD 8.0 and 8.1 sctp_structs.h contains: struct sctp_stream_in { struct sctp_readhead inqueue; uint16_t stream_no; uint16_t last_sequence_delivered; /* used for re-order */ uint8_t delivery_started; }; Furthermore sctp_process_a_data_chunk() contains: uint16_t strmno, strmseq; So I do not think the problem "is in all branches". Can you be more = specific, which version your are talking about? Best regards Michael >=20 >=20 >=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