From patchwork Thu Dec 3 13:56:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: riku.voipio@nokia.com X-Patchwork-Id: 40258 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F00F4B7BBC for ; Fri, 4 Dec 2009 09:11:30 +1100 (EST) Received: from localhost ([127.0.0.1]:60764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGJtW-0007Eq-Ha for incoming@patchwork.ozlabs.org; Thu, 03 Dec 2009 17:11:26 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGCAu-0001Jw-Lm for qemu-devel@nongnu.org; Thu, 03 Dec 2009 08:56:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGCAq-0001HT-7K for qemu-devel@nongnu.org; Thu, 03 Dec 2009 08:56:52 -0500 Received: from [199.232.76.173] (port=56414 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGCAq-0001HL-2I for qemu-devel@nongnu.org; Thu, 03 Dec 2009 08:56:48 -0500 Received: from smtp.nokia.com ([192.100.105.134]:42959 helo=mgw-mx09.nokia.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NGCAp-0008Fq-Lt for qemu-devel@nongnu.org; Thu, 03 Dec 2009 08:56:47 -0500 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nB3DuY5D023940 for ; Thu, 3 Dec 2009 07:56:44 -0600 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Dec 2009 15:56:43 +0200 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Dec 2009 15:56:42 +0200 Received: from localhost.localdomain (esdhcp041213.research.nokia.com [172.21.41.213]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nB3DuZp6027643; Thu, 3 Dec 2009 15:56:40 +0200 From: riku.voipio@nokia.com To: qemu-devel@nongnu.org Date: Thu, 3 Dec 2009 15:56:04 +0200 Message-Id: <4a9c7e041981cf60d80cb76f9e797fde44b4c1b1.1259836046.git.riku.voipio@nokia.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 03 Dec 2009 13:56:42.0890 (UTC) FILETIME=[71B456A0:01CA7420] X-Nokia-AV: Clean X-MIME-Autoconverted: from 8bit to quoted-printable by mgw-mx09.nokia.com id nB3DuY5D023940 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-Mailman-Approved-At: Thu, 03 Dec 2009 17:06:01 -0500 Cc: Riku Voipio , =?utf-8?q?Juha=20Riihim=C3=A4ki?= Subject: [Qemu-devel] [PATCH 3/7] fix networking on win32 host X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Juha Riihimäki At least under some mingw compilers slirp networking fails without declaring these fields packed. From: Juha Riihimäki Signed-off-by: Juha Riihimäki Signed-off-by: Riku Voipio --- slirp/ip.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/slirp/ip.h b/slirp/ip.h index 5074e33..8d185a1 100644 --- a/slirp/ip.h +++ b/slirp/ip.h @@ -91,7 +91,7 @@ struct ip { u_int8_t ip_p; /* protocol */ u_int16_t ip_sum; /* checksum */ struct in_addr ip_src,ip_dst; /* source and dest address */ -}; +} __attribute__((packed)); #define IP_MAXPACKET 65535 /* maximum packet size */ @@ -153,7 +153,7 @@ struct ip_timestamp { n_long ipt_time; } ipt_ta[1]; } ipt_timestamp; -}; +} __attribute__((packed)); /* flag bits for ipt_flg */ #define IPOPT_TS_TSONLY 0 /* timestamps only */ @@ -183,11 +183,11 @@ struct ip_timestamp { struct mbuf_ptr { struct mbuf *mptr; uint32_t dummy; -}; +} __attribute__((packed)); #else struct mbuf_ptr { struct mbuf *mptr; -}; +} __attribute__((packed)); #endif struct qlink { void *next, *prev; @@ -219,7 +219,7 @@ struct ipq { u_int8_t ipq_p; /* protocol of this fragment */ u_int16_t ipq_id; /* sequence id for reassembly */ struct in_addr ipq_src,ipq_dst; -}; +} __attribute__((packed)); /* * Ip header, when holding a fragment. @@ -229,7 +229,7 @@ struct ipq { struct ipasfrag { struct qlink ipf_link; struct ip ipf_ip; -}; +} __attribute__((packed)); #define ipf_off ipf_ip.ip_off #define ipf_tos ipf_ip.ip_tos @@ -248,6 +248,6 @@ struct ipasfrag { struct ipoption { struct in_addr ipopt_dst; /* first-hop dst if source routed */ int8_t ipopt_list[MAX_IPOPTLEN]; /* options proper */ -}; +} __attribute__((packed)); #endif