From: Jan Kiszka <jan.kiszka@siemens.com>
To: Fabien Chouteau <chouteau@adacore.com>
Cc: Thomas Huth <thuth@linux.vnet.ibm.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] slirp: Fix packet expiration
Date: Tue, 27 Sep 2011 12:59:20 +0200 [thread overview]
Message-ID: <4E81AC88.40905@siemens.com> (raw)
In-Reply-To: <4E81ABCF.5020101@adacore.com>
On 2011-09-27 12:56, Fabien Chouteau wrote:
> On 27/09/2011 11:20, Thomas Huth wrote:
>>
>> The two new variables "arp_requested" and "expiration_date" in the mbuf
>> structure have been added after the variable-sized "m_dat_" array. The
>> variables have to be added before the m_dat_ array instead.
>> Without this patch, the expiration_date gets clobbered by code that
>> accesses the m_dat_ array.
>> I experienced this problem with the code in slirp/tftp.c: The
>> tftp_send_data() function created a new packet with the m_get()
>> function (which fills-in a default expiration_date value). Then the
>> TFTP code cleared the data section of the packet, which accidentially
>> also cleared the expiration_date. This zeroed expiration_date then
>> finally causes the packet to be discarded during if_start(), so that
>> TFTP packets were not transmitted anymore.
>>
>
> Thanks for the patch Thomas.
>
> I think we can add a comment to avoid this kind of mistake in the
> future.
>
> /* This is a "flexible array member". It should always remain
> * the last member of the structure.
> */
Good point, folded something like that in.
Thanks,
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
prev parent reply other threads:[~2011-09-27 10:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 9:20 [Qemu-devel] [PATCH] slirp: Fix packet expiration Thomas Huth
2011-09-27 9:34 ` Jan Kiszka
2011-09-27 10:56 ` Fabien Chouteau
2011-09-27 10:59 ` Jan Kiszka [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E81AC88.40905@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=chouteau@adacore.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.