Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Dec 2010 10:15:13 +0100
From:      =?iso-8859-1?Q?Michael_T=FCxen?= <Michael.Tuexen@lurchi.franken.de>
To:        =?utf-8?B?572X6ZKw?= <blade_ly@yahoo.com.cn>
Cc:        freebsd-net@freebsd.org
Subject:   Re: [SCTP] last_sequence_delivered in sctp_process_a_data_chunk question
Message-ID:  <AD3C54B2-0378-4D70-81FE-F7F014703293@lurchi.franken.de>
In-Reply-To: <173127.17301.qm@web15007.mail.cnb.yahoo.com>
References:  <173127.17301.qm@web15007.mail.cnb.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Dec 15, 2010, at 8:46 AM, 罗钰 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) == 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) == 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
> 
> 
> 
> _______________________________________________
> 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"
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AD3C54B2-0378-4D70-81FE-F7F014703293>