[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
Re: [Qemu-devel] [PATCH 1/1] slirp: don't zero ti_i since we acccess it later.
Thu, 27 Apr 2017 15:21:26 +0200
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.
> > 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