qemu-devel
[Top][All Lists]
Advanced

[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: Mon, 8 May 2017 12:08:55 -0700

Hi Samuel,


There could 2 kind of bugs:

1.  For some reason, caller didn't setup anything in tcpiphdr, so there is
random data inside it.
2.  For some reason, caller setup correct src/dst address in tcpiphdr but
don't zero ix_h1

Actually I worried about bug 1 more than bug 2.

With assert in code, it's easy to catch bug 2 and bug 1.

But if I just zero ix_h1 in my code, then it's somewhat difficult to catch
bug 1. Finally the code could just send out some
random packets to some random address.

If you still think this doesn't look likely happen, I am fine with your
suggestion and will add zero for ih_x1, any comments?

On Thu, May 4, 2017 at 4:05 PM, Samuel Thibault <address@hidden>
wrote:

> Hello,
>
> lepton, on mer. 03 mai 2017 11:35:05 -0700, wrote:
> > It sounds like a bug that  caller set up a
> > right src and dst address and without set right ih_x1.
>
> I wouldn't bet on that. ih_x1 is only a filler, the caller can be using
> the structure only as a C structure, and it's only here just before the
> checksum computation that we really need ih_x1 to be 0.
>
> Samuel
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]