From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8U4b-0008AS-Ol for qemu-devel@nongnu.org; Tue, 27 Sep 2011 05:35:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8U4Z-0002xF-0N for qemu-devel@nongnu.org; Tue, 27 Sep 2011 05:35:33 -0400 Received: from goliath.siemens.de ([192.35.17.28]:32401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8U4Y-0002x0-Im for qemu-devel@nongnu.org; Tue, 27 Sep 2011 05:35:30 -0400 Message-ID: <4E8198BD.5070303@siemens.com> Date: Tue, 27 Sep 2011 11:34:53 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <20110927112038.42b5b3f8@BR8GGW75.de.ibm.com> In-Reply-To: <20110927112038.42b5b3f8@BR8GGW75.de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] slirp: Fix packet expiration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: "qemu-devel@nongnu.org" , Fabien Chouteau On 2011-09-27 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. > > Signed-off-by: Thomas Huth > ------- > slirp/mbuf.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/slirp/mbuf.h b/slirp/mbuf.h > index 55170e5..37b9dbb 100644 > --- a/slirp/mbuf.h > +++ b/slirp/mbuf.h > @@ -82,12 +82,12 @@ struct m_hdr { > struct mbuf { > struct m_hdr m_hdr; > Slirp *slirp; > + bool arp_requested; > + uint64_t expiration_date; > union M_dat { > char m_dat_[1]; /* ANSI don't like 0 sized arrays */ > char *m_ext_; > } M_dat; > - bool arp_requested; > - uint64_t expiration_date; > }; > > #define m_next m_hdr.mh_next Thanks, applied. What generates "-------" as separator? Confuses git am here. You may want to use standard "---" in the future. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux