From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwXjl-00036b-48 for qemu-devel@nongnu.org; Thu, 25 Aug 2011 07:04:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwXjj-0006kC-FU for qemu-devel@nongnu.org; Thu, 25 Aug 2011 07:04:41 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:49045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwXji-0006jR-Ua for qemu-devel@nongnu.org; Thu, 25 Aug 2011 07:04:39 -0400 Message-ID: <4E562C38.3010908@web.de> Date: Thu, 25 Aug 2011 13:04:24 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4E48BF2F.7080901@web.de> <4E501243.2090806@mail.berlios.de> <4E54C045.9020007@web.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig01A22760DDCEE34678828E10" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] [PULL] slirp: Fix issues with -mms-bitfields List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: TeLeMan Cc: Blue Swirl , Anthony Liguori , qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig01A22760DDCEE34678828E10 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2011-08-25 03:14, TeLeMan wrote: > On Wed, Aug 24, 2011 at 17:11, Jan Kiszka wrote: >> On 2011-08-23 12:49, TeLeMan wrote: >>> On Sun, Aug 21, 2011 at 04:00, Stefan Weil wro= te: >>>> Am 15.08.2011 08:39, schrieb Jan Kiszka: >>>>> >>>>> The following changes since commit >>>>> 3b6ffe50300f13240e1b46420ad05da1116df410: >>>>> >>>>> hw/scsi-bus.c: Fix use of uninitialised variable (2011-08-14 19:34:= 25 >>>>> +0000) >>>>> >>>>> are available in the git repository at: >>>>> git://git.kiszka.org/qemu.git queues/slirp >>>>> >>>>> Jan Kiszka (1): >>>>> slirp: Fix bit field types in IP header structs >>>>> >>>>> slirp/ip.h | 8 ++++---- >>>>> slirp/tcp.h | 4 ++-- >>>>> 2 files changed, 6 insertions(+), 6 deletions(-) >>>>> >>>>> --- >>>>> >>>>> slirp: Fix bit field types in IP header structs >>>>> >>>>> -mms-bitfields prevents that the bitfields in current IP header str= ucts >>>>> are packed into a single byte as it is required. Fix this by using >>>>> uint8_t as backing type. >>>>> >>>>> Signed-off-by: Jan Kiszka >>>>> --- >>>>> slirp/ip.h | 8 ++++---- >>>>> slirp/tcp.h | 4 ++-- >>>>> 2 files changed, 6 insertions(+), 6 deletions(-) >>>>> >>>>> diff --git a/slirp/ip.h b/slirp/ip.h >>>>> index 48ea38e..72dbe9a 100644 >>>>> --- a/slirp/ip.h >>>>> +++ b/slirp/ip.h >>>>> @@ -74,10 +74,10 @@ typedef uint32_t n_long; /* long as received fr= om the >>>>> net */ >>>>> */ >>>>> struct ip { >>>>> #ifdef HOST_WORDS_BIGENDIAN >>>>> - u_int ip_v:4, /* version */ >>>>> + uint8_t ip_v:4, /* version */ >>>>> ip_hl:4; /* header length */ >>>>> #else >>>>> - u_int ip_hl:4, /* header length */ >>>>> + uint8_t ip_hl:4, /* header length */ >>>>> ip_v:4; /* version */ >>>>> #endif >>>>> uint8_t ip_tos; /* type of service */ >>>>> @@ -140,10 +140,10 @@ struct ip_timestamp { >>>>> uint8_t ipt_len; /* size of structure (variable) */ >>>>> uint8_t ipt_ptr; /* index of current entry */ >>>>> #ifdef HOST_WORDS_BIGENDIAN >>>>> - u_int ipt_oflw:4, /* overflow counter */ >>>>> + uint8_t ipt_oflw:4, /* overflow counter */ >>>>> ipt_flg:4; /* flags, see below */ >>>>> #else >>>>> - u_int ipt_flg:4, /* flags, see below */ >>>>> + uint8_t ipt_flg:4, /* flags, see below */ >>>>> ipt_oflw:4; /* overflow counter */ >>>>> #endif >>>>> union ipt_timestamp { >>>>> diff --git a/slirp/tcp.h b/slirp/tcp.h >>>>> index 9d06836..b3817cb 100644 >>>>> --- a/slirp/tcp.h >>>>> +++ b/slirp/tcp.h >>>>> @@ -51,10 +51,10 @@ struct tcphdr { >>>>> tcp_seq th_seq; /* sequence number */ >>>>> tcp_seq th_ack; /* acknowledgement number */ >>>>> #ifdef HOST_WORDS_BIGENDIAN >>>>> - u_int th_off:4, /* data offset */ >>>>> + uint8_t th_off:4, /* data offset */ >>>>> th_x2:4; /* (unused) */ >>>>> #else >>>>> - u_int th_x2:4, /* (unused) */ >>>>> + uint8_t th_x2:4, /* (unused) */ >>>>> th_off:4; /* data offset */ >>>>> #endif >>>>> uint8_t th_flags; >>>> >>>> Tested-by: Stefan Weil >>>> >>> slirp is still broken on my mingw32. I used "#progma >>> pack(push,1)/#progma pack(pop)" to resolve this issue. >> >> Can you drill down to the bottom of this problem? What fields in what >> struct are not properly packed? Maybe this is now a compiler bug, so >> comparing versions may make sense as well. > arphdr.ar_sip is not aligned on a 4-byte boundary. See my previous pos= t: > http://lists.gnu.org/archive/html/qemu-devel/2011-08/msg00964.html What a mess. Do we really have to go through all 257 packed data structs in QEMU and add these MS compat bits to all potentially affected ones? Jan --------------enig01A22760DDCEE34678828E10 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5WLEEACgkQitSsb3rl5xRilQCg59m9fy0WevDWdiFmVwed+KZC kpAAoLyjxBxioqNsfAINFqw4X6PKt86B =ahHv -----END PGP SIGNATURE----- --------------enig01A22760DDCEE34678828E10--