From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fab7S-0002LN-AU for qemu-devel@nongnu.org; Mon, 01 May 2006 12:19:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fab7O-0002Kj-A3 for qemu-devel@nongnu.org; Mon, 01 May 2006 12:19:29 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fab7O-0002Kc-2h for qemu-devel@nongnu.org; Mon, 01 May 2006 12:19:26 -0400 Received: from [64.233.184.229] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FabBE-0004Mm-LG for qemu-devel@nongnu.org; Mon, 01 May 2006 12:23:24 -0400 Received: by wproxy.gmail.com with SMTP id i28so2166726wra for ; Mon, 01 May 2006 09:19:25 -0700 (PDT) Message-ID: <6fe044190605010919q23dcfa19t1d992211c58f679d@mail.gmail.com> Date: Mon, 1 May 2006 09:19:25 -0700 From: "Kenneth Duda" Sender: ken.duda@gmail.com Subject: Re: [Qemu-devel] [PATCH] Fix scrambling of >32KB packets in slirp In-Reply-To: <4455EC13.9040000@bellard.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4455EC13.9040000@bellard.org> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Well that is a good question. When I made this patch, I wanted to respect the comment in the code that the author felt that using a signed data type was safer in some cases. However, I will admit that I do not understand this reasoning, and I agree that switching to an unsigned data type would be better. Would you like us to resubmit this patch in that form? -Ken On 5/1/06, Fabrice Bellard wrote: > Ed Swierk wrote: > > In several places in qemu's slirp code, signed and unsigned ints are > > used interchangeably when dealing with IP packet lengths and offsets. > > This causes IP packets greater than 32K in length to be scrambled in > > various interesting ways that are extremely difficult to troubleshoot. > > > > Although large IP packets are fairly rare in practice, certain > > UDP-based protocols like NFS use them extensively. > > > > The attached patch wraps IP packet lengths and offsets in macros that > > ensure they are always properly treated as unsigned values. > > Why not changing the definition itself to uint16_t and verifying each > occurence of ip_off and ip_len ? > > Fabrice. > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel >