[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/1] slirp: don't zero ti_i since we acccess it
From: |
lepton |
Subject: |
Re: [Qemu-devel] [PATCH 1/1] slirp: don't zero ti_i since we acccess it later. |
Date: |
Wed, 3 May 2017 11:35:05 -0700 |
Hi Samuel,
Should I add an assert for ih_x1? It sounds like a bug that caller set up
a right src and dst address and without set right ih_x1.
On Thu, Apr 27, 2017 at 6:21 AM, Samuel Thibault <address@hidden>
wrote:
> Hello,
>
> Thomas Huth, on lun. 24 avril 2017 11:15:56 +0200, wrote:
> > On 20.04.2017 22:43, Tao Wu wrote:
> > > The current code looks buggy, we zero ti_i while we access
> > > ti_dst/ti_src later.
>
> Indeed.
>
> > > Signed-off-by: Tao Wu <address@hidden>
>
> > > *mtod(m, struct tcpiphdr *) = *ti;
> > > ti = mtod(m, struct tcpiphdr *);
> > > - memset(&ti->ti, 0, sizeof(ti->ti));
>
> But then we don't make sure that ih_x1 is 0, which is needed for the
> checksum to be correct, but possibly not set by the caller.
>
> So please replace the memset call with setting the proper ih_x1 field to
> 0 (which thus needs the introductino of a switch over af like below in
> the code).
>
> Samuel
>
- Re: [Qemu-devel] [PATCH 1/1] slirp: don't zero ti_i since we acccess it later.,
lepton <=