From patchwork Mon Jan 8 17:28:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856947 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qfXobxQa"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFj6J6lzZz9s74 for ; Tue, 9 Jan 2018 04:33:12 +1100 (AEDT) Received: from localhost ([::1]:46980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbIN-0001yX-19 for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:33:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbEa-00080y-1d for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbEZ-0008L4-4Y for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:16 -0500 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:42847) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbEZ-0008KV-0L for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:15 -0500 Received: by mail-qk0-x243.google.com with SMTP id d202so15091031qkc.9 for ; Mon, 08 Jan 2018 09:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zK0xYjKtPdBGHDdAS5b19DY5vVhlqFJgNyVJCGi58Hg=; b=qfXobxQabOh79+Ofge0isQkxVdcltvEnUSewy/WOiPAtzICzsPbhSXU9a8ARm1pkCC nEZIXi6xNpWq0Mq7klrT39fTf+7e1rDOsFSWKQRzChFX6lSTcYQw8jDA1rYM7df5Ffcs WlKAxMTzTr++Qx4i3MAK2uzYhHqtinpkP5TU5khwBvC/6tjiHAopWecK1Gzyz84u4Juv V+44kXfDxHn8vJVeiQOTywS28SngG/jbzmIC08U3mt/fkj51w1dKZSvLcrJ9C7jLXoeR zSon/Znmvvp4ENPVcsQqubzi3IJiZ0s4otXmH696mUMf3JEnLgToWviom3I1hp+etIFT N29g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zK0xYjKtPdBGHDdAS5b19DY5vVhlqFJgNyVJCGi58Hg=; b=EDYXDK4f34QPUsApHCYw4thCQ6SzxMynqAXgBkd1OffhFK9R7TssjuK1KIX+oNYw1n M+Vptx9YtHi4RtGc3uyuu65opjxBAP0+0aeCDpOoZVuSTPz92lndbEVWnbiqDs7VVs51 H8f24HlMVPBtsUF/lgBKRp3eGskrwATOGFlHOwmWO2mKeSRkAGm4qcDQnjiwWOaQ4AlQ Um4kkt6gP1i4vcZyotp3+rF4loz3ObT3Km5Ma9jATXf2zS811JMrramy6zlvziLIV5BF B7vSzgwxmuCTzgYvTWNwurqxu+701L40H7RrFnznunBInDQjvtD23WbqVExYh05e9uTH lBFA== X-Gm-Message-State: AKwxytfCHpK14gw1cI5QWj7gCsktmuekrrHuBEQ+VHBgYNpiLsBp54aE 2TIxnYz94e5Rd8kEXPIslww= X-Google-Smtp-Source: ACJfBot0mHd2T/UM9gwMlwN1vhtsGgdInO3OENo7BKMleIcOwWa9RFaUCS+k2psLEn+7tp4ghCiwIg== X-Received: by 10.55.212.129 with SMTP id s1mr17924708qks.44.1515432554433; Mon, 08 Jan 2018 09:29:14 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth Date: Mon, 8 Jan 2018 14:28:53 -0300 Message-Id: <20180108172904.8772-2-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 01/12] slirp: remove QEMU_PACKED from structures with don't require it X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" theses structures are not serialized and often store host pointers. slirp/ip_input.c:159:43: warning: taking address of packed member 'ip_link' of class or structure 'ipq' may result in an unaligned pointer value [-Waddress-of-packed-member] for (l = slirp->ipq.ip_link.next; l != &slirp->ipq.ip_link; ^~~~~~~~~~~~~~~~~~ Reported-by: John Arbuckle Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- slirp/ip.h | 10 +++++----- slirp/slirp.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/slirp/ip.h b/slirp/ip.h index 1df6723357..e29ccd3c9f 100644 --- a/slirp/ip.h +++ b/slirp/ip.h @@ -179,11 +179,11 @@ struct ip_timestamp { struct mbuf_ptr { struct mbuf *mptr; uint32_t dummy; -} QEMU_PACKED; +}; #else struct mbuf_ptr { struct mbuf *mptr; -} QEMU_PACKED; +}; #endif struct qlink { void *next, *prev; @@ -199,7 +199,7 @@ struct ipovly { uint16_t ih_len; /* protocol length */ struct in_addr ih_src; /* source internet address */ struct in_addr ih_dst; /* destination internet address */ -} QEMU_PACKED; +}; /* * Ip reassembly queue structure. Each fragment @@ -215,7 +215,7 @@ struct ipq { uint8_t ipq_p; /* protocol of this fragment */ uint16_t ipq_id; /* sequence id for reassembly */ struct in_addr ipq_src,ipq_dst; -} QEMU_PACKED; +}; /* * Ip header, when holding a fragment. @@ -225,7 +225,7 @@ struct ipq { struct ipasfrag { struct qlink ipf_link; struct ip ipf_ip; -} QEMU_PACKED; +}; #define ipf_off ipf_ip.ip_off #define ipf_tos ipf_ip.ip_tos diff --git a/slirp/slirp.h b/slirp/slirp.h index 898ec9516d..9f29b52610 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -136,7 +136,7 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr, struct ndpentry { unsigned char eth_addr[ETH_ALEN]; /* sender hardware address */ struct in6_addr ip_addr; /* sender IP address */ -} QEMU_PACKED; +}; #define NDP_TABLE_SIZE 16 From patchwork Mon Jan 8 17:28:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856946 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tR0l6DaB"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFj322Y3Vz9s4s for ; Tue, 9 Jan 2018 04:30:22 +1100 (AEDT) Received: from localhost ([::1]:46969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbFc-0008GB-CW for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:30:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbEd-00083N-1c for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbEc-0008Pm-7r for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:19 -0500 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:46339) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbEc-0008PE-3j for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:18 -0500 Received: by mail-qk0-x241.google.com with SMTP id l12so14750630qke.13 for ; Mon, 08 Jan 2018 09:29:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TthngJ5DDtkitAo4wCaBEdaKUWAUgMKak36jYhOPZLA=; b=tR0l6DaBxpD5XPuN4kw5W8QkweTLT83gspRnirP/b0mzobumUEtsi1rASIzEljMd3j kB508gAd8WfbU0fkf/uJzmM27J/S+QmDa8dOkFPTUVgmQRuwE1r0PJEp5Fs4R6d6AN1S 6MSAcNuOZ83ePhLtdokg0k1TZM1s0N9I4FApbiscNhiCl9/2Jr5cfjFX2ZB75DStVdFk NiIiB2pqupV3Owu1nAbkrLGz6E3ijm7KIHYV8HgCFmn4mgW6KS35VRVh9ORJxN5AM3Rs nvcW1OKLBmnpaDP7g8aPPCkIF2FgPnJB1w7rlCdF3hsGxswTUjUOcvE7LvZfpZ1Y3FTx 1gVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TthngJ5DDtkitAo4wCaBEdaKUWAUgMKak36jYhOPZLA=; b=eWs+VufNSONVbHsQhT2EHlDCcxhmRlVBUO8PLbyRaoPBO4j3q7c7yFXVNGlf1DlGML C57p/bxpr3Zj1JB1unlqQ6mojKgFkN399ouSfZrRqv3K9WHf4MBCEmE/oLm0tgsSIbsZ kyO4N48Wy0b0DBxZyLcj09CQJeoQ2zs80JyC5GGTc+jhcTkJjRKy1JLTuyPmVfwNyeUH SIGh4Sh/xKOhcsDKcHhwxrNkW72eamVCL7+N4n9rXzQbRiezjvtFl0Z5uKmX9AT2WNTL cT1PW/qXqqCvBnvlrQiqAi6B0wVP/wui0UFTHnrAqvWnucpiVuSa7x+in7BRRSI5h4X6 i9tg== X-Gm-Message-State: AKwxytdAL7rHqrGS/7ecaDd3/E+Jyrm22GkkUdeYoXkD8Ol/Vg1r4ekV noMZiAsu8zyKNQbAl1bI2Xw= X-Google-Smtp-Source: ACJfBov4gO6fGiLkzv6Mlyyk40pL79xueTgSCZ/PFWHp1P6afttEOBfYj0M3V+ZCDZb0qBDeXevBmA== X-Received: by 10.55.76.193 with SMTP id z184mr17061419qka.318.1515432557576; Mon, 08 Jan 2018 09:29:17 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth Date: Mon, 8 Jan 2018 14:28:54 -0300 Message-Id: <20180108172904.8772-3-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 02/12] slirp: struct icmp/ethhdr ARE packed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- slirp/ip6_icmp.h | 6 +++--- slirp/ip_icmp.h | 2 +- slirp/slirp.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/slirp/ip6_icmp.h b/slirp/ip6_icmp.h index b3378b17b5..a4ccc69974 100644 --- a/slirp/ip6_icmp.h +++ b/slirp/ip6_icmp.h @@ -17,20 +17,20 @@ struct icmp6_echo { /* Echo Messages */ uint16_t id; uint16_t seq_num; -}; +} QEMU_PACKED; union icmp6_error_body { uint32_t unused; uint32_t pointer; uint32_t mtu; -}; +} QEMU_PACKED; /* * NDP Messages */ struct ndp_rs { /* Router Solicitation Message */ uint32_t reserved; -}; +} QEMU_PACKED; struct ndp_ra { /* Router Advertisement Message */ uint8_t chl; /* Cur Hop Limit */ diff --git a/slirp/ip_icmp.h b/slirp/ip_icmp.h index d88ab34c1b..e53242bdd8 100644 --- a/slirp/ip_icmp.h +++ b/slirp/ip_icmp.h @@ -88,7 +88,7 @@ struct icmp { #define icmp_ip icmp_dun.id_ip.idi_ip #define icmp_mask icmp_dun.id_mask #define icmp_data icmp_dun.id_data -}; +} QEMU_PACKED; /* * Lower bounds on packet lengths for various types. diff --git a/slirp/slirp.h b/slirp/slirp.h index 9f29b52610..9a7287e7cc 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -103,7 +103,7 @@ struct ethhdr { unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ unsigned char h_source[ETH_ALEN]; /* source ether addr */ unsigned short h_proto; /* packet type ID field */ -}; +} QEMU_PACKED; struct slirp_arphdr { unsigned short ar_hrd; /* format of hardware address */ From patchwork Mon Jan 8 17:28:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856944 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cWEklN5G"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFj2s1j09z9s4s for ; Tue, 9 Jan 2018 04:30:13 +1100 (AEDT) Received: from localhost ([::1]:46958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbFT-00089d-8h for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:30:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbEi-00087S-Hc for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbEf-0008UQ-D0 for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:24 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:42952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbEf-0008Tp-8g for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:21 -0500 Received: by mail-qt0-x244.google.com with SMTP id g9so14526144qth.9 for ; Mon, 08 Jan 2018 09:29:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LN/3meoTPfJi74I+z0Zajww3FRTJjjGyCJ9jcM5HPys=; b=cWEklN5GOabTW0Aa8EOj7Z2OT6oGfe9M4fCtmnJYY9lHM00zgKc8LFy9ba623ILemj W8ZNpWFseZSwknt96AQigsfpNXxVgU/pjvG0wF9+oSBg9Wn1Y4C9MsW3yjtoNZe9fqjm +LbCR56ka734oDuufA7W6G1ldF5POlcz80CrZB54pGCoYWS133Dqgi3vWO5N5duAjJ2A bc+T5l20cZ96r/vjY4ks5dPVGcS190meF3NKIJbhqQvFKhNuiT+p3uW3VCqc1ogq36/S iC8KxM2ch132c3LRP1FoSrukuFsacQ43cOPVti7bMrgqoQ975J0BkoGil9v7L9JyDTDT ygNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LN/3meoTPfJi74I+z0Zajww3FRTJjjGyCJ9jcM5HPys=; b=F6Bu5nkJrStKSmKqzgSm9QO9s5XEWgPXT2k+fUr51HiVmV9ys/Cxbf17QFLuiKxE5F /ngIYpafcd0FqSflBaA16wK0GptGrD9KKkbSSjsJx4cTTMGeMAaX8mKmvAcYPHLO6Bfn 5uNhEphn6nxEKX50WA+sIft+5aEAvXPxZoAO0oF2K/6WdsrqgWf4nltEGc14c2Gn4xG9 Iz3UcGl252YRNt1egs9xSXYQeo60Vf6dR7kMMWM8W/18wMLkoD1dy6WLQkkocwR9y1jr 8sqNRlyexYy3OBkBIiN3130WjV/TG7SwrTICkq9QU2cFgq2kTFHHteals9RB/S5ZThuS hsbA== X-Gm-Message-State: AKwxytcGukK4RY8ZBbpHqr3kIJeGyDASJt1cld47LeeE0ZGZyrXvZP46 o0GIqhr/1BkvsH3H0NpgMwE= X-Google-Smtp-Source: ACJfBov8pc9fZ/sFcCUN5nxARz4c8O0hsV+OXwnXHlcDbmRX0Vi4BSd3qF4o28G0hGM43l3t8g5Jmg== X-Received: by 10.200.2.157 with SMTP id p29mr17179967qtg.155.1515432560700; Mon, 08 Jan 2018 09:29:20 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth Date: Mon, 8 Jan 2018 14:28:55 -0300 Message-Id: <20180108172904.8772-4-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 03/12] slirp: avoid IN6_IS_ADDR_UNSPECIFIED(), rather use in6_zero() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Host: Mac OS 10.12.5 Compiler: Apple LLVM version 8.1.0 (clang-802.0.42) slirp/ip6_icmp.c:80:38: warning: taking address of packed member 'ip_src' of class or structure 'ip6' may result in an unaligned pointer value [-Waddress-of-packed-member] IN6_IS_ADDR_UNSPECIFIED(&ip->ip_src)) { ^~~~~~~~~~ /usr/include/netinet6/in6.h:238:42: note: expanded from macro 'IN6_IS_ADDR_UNSPECIFIED' ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ ^ Reported-by: John Arbuckle Signed-off-by: Philippe Mathieu-Daudé --- slirp/ip6_icmp.c | 6 +++--- slirp/ndp_table.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/slirp/ip6_icmp.c b/slirp/ip6_icmp.c index 777eb574be..ee333d05a2 100644 --- a/slirp/ip6_icmp.c +++ b/slirp/ip6_icmp.c @@ -77,7 +77,7 @@ void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code) DEBUG_ARGS((dfd, " type = %d, code = %d\n", type, code)); if (IN6_IS_ADDR_MULTICAST(&ip->ip_src) || - IN6_IS_ADDR_UNSPECIFIED(&ip->ip_src)) { + in6_zero(&ip->ip_src)) { /* TODO icmp error? */ return; } @@ -272,7 +272,7 @@ static void ndp_send_na(Slirp *slirp, struct ip6 *ip, struct icmp6 *icmp) struct mbuf *t = m_get(slirp); struct ip6 *rip = mtod(t, struct ip6 *); rip->ip_src = icmp->icmp6_nns.target; - if (IN6_IS_ADDR_UNSPECIFIED(&ip->ip_src)) { + if (in6_zero(&ip->ip_src)) { rip->ip_dst = (struct in6_addr)ALLNODES_MULTICAST; } else { rip->ip_dst = ip->ip_src; @@ -350,7 +350,7 @@ static void ndp_input(struct mbuf *m, Slirp *slirp, struct ip6 *ip, && icmp->icmp6_code == 0 && !IN6_IS_ADDR_MULTICAST(&icmp->icmp6_nns.target) && ntohs(ip->ip_pl) >= ICMP6_NDP_NS_MINLEN - && (!IN6_IS_ADDR_UNSPECIFIED(&ip->ip_src) + && (!in6_zero(&ip->ip_src) || in6_solicitednode_multicast(&ip->ip_dst))) { if (in6_equal_host(&icmp->icmp6_nns.target)) { /* Gratuitous NDP */ diff --git a/slirp/ndp_table.c b/slirp/ndp_table.c index 9d4c39b45c..e1676a0a7b 100644 --- a/slirp/ndp_table.c +++ b/slirp/ndp_table.c @@ -23,7 +23,7 @@ void ndp_table_add(Slirp *slirp, struct in6_addr ip_addr, ethaddr[0], ethaddr[1], ethaddr[2], ethaddr[3], ethaddr[4], ethaddr[5])); - if (IN6_IS_ADDR_MULTICAST(&ip_addr) || IN6_IS_ADDR_UNSPECIFIED(&ip_addr)) { + if (IN6_IS_ADDR_MULTICAST(&ip_addr) || in6_zero(&ip_addr)) { /* Do not register multicast or unspecified addresses */ DEBUG_CALL(" abort: do not register multicast or unspecified address"); return; @@ -60,7 +60,7 @@ bool ndp_table_search(Slirp *slirp, struct in6_addr ip_addr, DEBUG_ARG("ip = %s", addrstr); #endif - assert(!IN6_IS_ADDR_UNSPECIFIED(&ip_addr)); + assert(!in6_zero(&ip_addr)); /* Multicast address: fec0::abcd:efgh/8 -> 33:33:ab:cd:ef:gh */ if (IN6_IS_ADDR_MULTICAST(&ip_addr)) { From patchwork Mon Jan 8 17:28:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="L+QYo2mJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFj6p69Rxz9s74 for ; Tue, 9 Jan 2018 04:33:38 +1100 (AEDT) Received: from localhost ([::1]:46992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbIm-0002M6-PK for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:33:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbEj-00088L-Q4 for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbEi-00006s-MR for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:25 -0500 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:45163) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbEi-00006O-HV for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:24 -0500 Received: by mail-qt0-x241.google.com with SMTP id g10so14518174qtj.12 for ; Mon, 08 Jan 2018 09:29:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6VekvQluN2/YEmicRBuoEFHj4BFLqNTFprISPH+UcQ4=; b=L+QYo2mJnwUb0GCjYTL7rAYxY6TpOBC1xsQUKA2dl8CHkXhbIEl67OkSNlojRXfTnF c2IRXGM1VobVVjEkCeZL+9qeqVUw1iSSHoFPpbDIXmXTr4d4CXkIEKJCQwd8aGcAr/hq jcBcFTrFstSJQzXnJ8KeoiqYzdNyzG1D0ax+4Yy/9Lu2yiWY8pKVaMpqLXSM3AyZMCfl 3qtjyYHv238hUyWNLHtr5zesIWBDA7HkVgzBFcLP1UGQSdjcQ9T4bNBFLNOpD8PC5KS8 Ehl40l7w0zt6n57pOXAAxfG4EL7wsL+AktgkOyPaab7WpHtMVpe6hzztFFTZcqlGAEM0 k6BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6VekvQluN2/YEmicRBuoEFHj4BFLqNTFprISPH+UcQ4=; b=oAuvCa71a/s/ySMeBmURvYBKV74u5vWah7XY9kxzZwoWR8o0xYA8/mjeIXZ5GEG6x5 bY81qRZGUzYspHQo1xLJO8hOr288GkAg4LCygM355z/1qFjJG3g0YJIHoXMggqhkRx9/ d+OHczJWqMHV3IfajeCr+j2SEGEsCs2NFxUd2/Co3D15NPsBFBjCpNvpLklLQRlrkrIp qazW81h5tFw2i4tLBjkg6OFCe4Hp5nMKCZMkNXrHD1zp1caT77ZrWekwDCxakfhCfYeu rCKsTQPWRZnNl+Mu9BIF7iK1MchxGwQZjkkNIMkdcZOv3M7YzJsrDhfWB7aPQ2l6Whfl hU3Q== X-Gm-Message-State: AKwxytfcnuLgxunMpbMM+yPj+TU+Pq1vnaJBE9JCOzyKYi25Zl86X0kS byRlBTO5NBz9oVT08WH3rGA= X-Google-Smtp-Source: ACJfBoujvVShwJq2KXPCbdmzYYXJXeiNnLjkJv3eZkOVXewggnEUxG7TG8o1JBuW/DlcQmPznP8rmw== X-Received: by 10.200.44.111 with SMTP id e44mr17648434qta.183.1515432563929; Mon, 08 Jan 2018 09:29:23 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth Date: Mon, 8 Jan 2018 14:28:56 -0300 Message-Id: <20180108172904.8772-5-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 04/12] slirp: add in6_multicast() and use it instead of IN6_IS_ADDR_MULTICAST() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Host: Mac OS 10.12.5 Compiler: Apple LLVM version 8.1.0 (clang-802.0.42) slirp/ip6_icmp.c:79:32: warning: taking address of packed member 'ip_src' of class or structure 'ip6' may result in an unaligned pointer value [-Waddress-of-packed-member] if (IN6_IS_ADDR_MULTICAST(&ip->ip_src) || ^~~~~~~~~~ /usr/include/netinet6/in6.h:299:36: note: expanded from macro 'IN6_IS_ADDR_MULTICAST' #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) ^ Reported-by: John Arbuckle Signed-off-by: Philippe Mathieu-Daudé --- slirp/ip6.h | 5 +++++ slirp/ip6_icmp.c | 10 +++++----- slirp/ndp_table.c | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/slirp/ip6.h b/slirp/ip6.h index b1bea43b3c..6c5d4eeaa3 100644 --- a/slirp/ip6.h +++ b/slirp/ip6.h @@ -93,6 +93,11 @@ static inline bool in6_equal_mach(const struct in6_addr *a, #define in6_zero(a)\ (in6_equal(a, &(struct in6_addr)ZERO_ADDR)) +static inline bool in6_multicast(const struct in6_addr *a) +{ + return a->s6_addr[0] == 0xff; +} + /* Compute emulated host MAC address from its ipv6 address */ static inline void in6_compute_ethaddr(struct in6_addr ip, uint8_t eth[ETH_ALEN]) diff --git a/slirp/ip6_icmp.c b/slirp/ip6_icmp.c index ee333d05a2..9796624648 100644 --- a/slirp/ip6_icmp.c +++ b/slirp/ip6_icmp.c @@ -76,7 +76,7 @@ void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code) DEBUG_CALL("icmp6_send_error"); DEBUG_ARGS((dfd, " type = %d, code = %d\n", type, code)); - if (IN6_IS_ADDR_MULTICAST(&ip->ip_src) || + if (in6_multicast(&ip->ip_src) || in6_zero(&ip->ip_src)) { /* TODO icmp error? */ return; @@ -291,7 +291,7 @@ static void ndp_send_na(Slirp *slirp, struct ip6 *ip, struct icmp6 *icmp) /* NDP */ ricmp->icmp6_nna.R = NDP_IsRouter; - ricmp->icmp6_nna.S = !IN6_IS_ADDR_MULTICAST(&rip->ip_dst); + ricmp->icmp6_nna.S = !in6_multicast(&rip->ip_dst); ricmp->icmp6_nna.O = 1; ricmp->icmp6_nna.reserved_hi = 0; ricmp->icmp6_nna.reserved_lo = 0; @@ -348,7 +348,7 @@ static void ndp_input(struct mbuf *m, Slirp *slirp, struct ip6 *ip, DEBUG_CALL(" type = Neighbor Solicitation"); if (ip->ip_hl == 255 && icmp->icmp6_code == 0 - && !IN6_IS_ADDR_MULTICAST(&icmp->icmp6_nns.target) + && !in6_multicast(&icmp->icmp6_nns.target) && ntohs(ip->ip_pl) >= ICMP6_NDP_NS_MINLEN && (!in6_zero(&ip->ip_src) || in6_solicitednode_multicast(&ip->ip_dst))) { @@ -365,8 +365,8 @@ static void ndp_input(struct mbuf *m, Slirp *slirp, struct ip6 *ip, if (ip->ip_hl == 255 && icmp->icmp6_code == 0 && ntohs(ip->ip_pl) >= ICMP6_NDP_NA_MINLEN - && !IN6_IS_ADDR_MULTICAST(&icmp->icmp6_nna.target) - && (!IN6_IS_ADDR_MULTICAST(&ip->ip_dst) + && !in6_multicast(&icmp->icmp6_nna.target) + && (!in6_multicast(&ip->ip_dst) || icmp->icmp6_nna.S == 0)) { ndp_table_add(slirp, ip->ip_src, eth->h_source); } diff --git a/slirp/ndp_table.c b/slirp/ndp_table.c index e1676a0a7b..5ff4bf2f3d 100644 --- a/slirp/ndp_table.c +++ b/slirp/ndp_table.c @@ -23,7 +23,7 @@ void ndp_table_add(Slirp *slirp, struct in6_addr ip_addr, ethaddr[0], ethaddr[1], ethaddr[2], ethaddr[3], ethaddr[4], ethaddr[5])); - if (IN6_IS_ADDR_MULTICAST(&ip_addr) || in6_zero(&ip_addr)) { + if (in6_multicast(&ip_addr) || in6_zero(&ip_addr)) { /* Do not register multicast or unspecified addresses */ DEBUG_CALL(" abort: do not register multicast or unspecified address"); return; @@ -63,7 +63,7 @@ bool ndp_table_search(Slirp *slirp, struct in6_addr ip_addr, assert(!in6_zero(&ip_addr)); /* Multicast address: fec0::abcd:efgh/8 -> 33:33:ab:cd:ef:gh */ - if (IN6_IS_ADDR_MULTICAST(&ip_addr)) { + if (in6_multicast(&ip_addr)) { out_ethaddr[0] = 0x33; out_ethaddr[1] = 0x33; out_ethaddr[2] = ip_addr.s6_addr[12]; out_ethaddr[3] = ip_addr.s6_addr[13]; From patchwork Mon Jan 8 17:28:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856945 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YykoCAd7"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFj301MMBz9sNr for ; Tue, 9 Jan 2018 04:30:20 +1100 (AEDT) Received: from localhost ([::1]:46964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbFZ-0008Da-BR for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:30:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbEm-0008AM-Bc for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbEl-0000B1-KC for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:28 -0500 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:46355) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbEl-0000Aa-FL for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:27 -0500 Received: by mail-qt0-x241.google.com with SMTP id r39so14514502qtr.13 for ; Mon, 08 Jan 2018 09:29:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2MIEl9NDWrzbHQDV8K7Evt3ssuKLY2d2bNxcwVJoFnc=; b=YykoCAd7XnDM7G43/DSEH20zWjooXgI7QUZjjnQBUA3kVQwKfVn8DibrxcEoToI2dX 4vZkb02vCNGc8u47lJXzNU9z44h6asp8G1dIX25tMRCfsnhEq6OJQn9MfgTUGKOHhN59 A7c/LpYr+/yfsIfrYcF7ZSq61T4i/vXGbnPbwOBMVokI9yQrssXIWxW5ver891IN/c6G GZQatZouQMjjVC8ENjPr0v1o5TlTf980+EibwFGVQ/g38lJ5nZSmlfieC13UUnXuaffT 7O/jA4bA0dFzaSzkxwKYtpkaTUYg1IS6vzBz2c1MyeR8oUb4dH25mXfSuquBRqMNSsC/ CBLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2MIEl9NDWrzbHQDV8K7Evt3ssuKLY2d2bNxcwVJoFnc=; b=G+hemUOcRMDgDv5JnyY18WbAbtt2ogJ6WO6ejmZqsFS5R2OhInnzrULyBhDcaDCcK0 31Kpv1Ef1/VrzVL7vhIkdzDnFfpl+ubpUG3GxZMWQLq9iZYFGShEr/3BIPwI1t6mlY1Q hOi5PsaFOB3/3ev/um4GIug9hf8pQTlB4HcGGyq13xBM4CIK5G4t9OQSeLz5pxUM1A2F f/EzxFrEdHP/Pet/BKXRurXu2a0KNqVOLaT/u7hXdM32nSk9JRAdvXtYSxsCGXARDsp3 wDBrNAzGyPDDGm/YldGjJCE+JgosVlKR+0em3PNGe06csNYzXMf4gpp1XZEBX0SgOlWL FlJw== X-Gm-Message-State: AKwxytf6lQiz0EvuHueZyph/y/R3dGrC0lk6GdsAohZRAxcSsDogoWcf esZoIolMF94DKdxME1S/WtFj5x5e X-Google-Smtp-Source: ACJfBos7N/QhreOdAkNtMDumxY5+QsXayq/Lwlwcayxjs968SylOPatGte/PhJ2fDKRxrGDpaDIL8w== X-Received: by 10.237.33.154 with SMTP id l26mr17604579qtc.100.1515432566940; Mon, 08 Jan 2018 09:29:26 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth Date: Mon, 8 Jan 2018 14:28:57 -0300 Message-Id: <20180108172904.8772-6-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 05/12] slirp: poison IN6_*_ADDR_*() macros to avoid them X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- slirp/ip6.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/slirp/ip6.h b/slirp/ip6.h index 6c5d4eeaa3..c6493a0856 100644 --- a/slirp/ip6.h +++ b/slirp/ip6.h @@ -8,6 +8,25 @@ #include "net/eth.h" +#ifdef __GNUC__ +# undef IN6_IS_ADDR_UNSPECIFIED +# pragma GCC poison IN6_IS_ADDR_UNSPECIFIED +# undef IN6_IS_ADDR_LOOPBACK +# pragma GCC poison IN6_IS_ADDR_LOOPBACK +# undef IN6_IS_ADDR_LINKLOCAL +# pragma GCC poison IN6_IS_ADDR_LINKLOCAL +# undef IN6_IS_ADDR_SITELOCAL +# pragma GCC poison IN6_IS_ADDR_SITELOCAL +# undef IN6_IS_ADDR_V4MAPPED +# pragma GCC poison IN6_IS_ADDR_V4MAPPED +# undef IN6_IS_ADDR_V4COMPAT +# pragma GCC poison IN6_IS_ADDR_V4COMPAT +# undef IN6_ARE_ADDR_EQUAL +# pragma GCC poison IN6_ARE_ADDR_EQUAL +# undef IN6_IS_ADDR_MULTICAST +# pragma GCC poison IN6_IS_ADDR_MULTICAST +#endif + #define ALLNODES_MULTICAST { .s6_addr = \ { 0xff, 0x02, 0x00, 0x00,\ 0x00, 0x00, 0x00, 0x00,\ From patchwork Mon Jan 8 17:28:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856950 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cTzoCU1+"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFj6m2mK0z9sNV for ; Tue, 9 Jan 2018 04:33:36 +1100 (AEDT) Received: from localhost ([::1]:46990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbIk-0002LX-Bu for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:33:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbEs-0008Fn-5C for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbEo-0000FC-Ni for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:34 -0500 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:36058) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbEo-0000EY-KA for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:30 -0500 Received: by mail-qk0-x242.google.com with SMTP id d21so4110819qkj.3 for ; Mon, 08 Jan 2018 09:29:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ngXSTc5I+kbX2tsoBIw/ypTTw54CR+L8uwvTGmN2r20=; b=cTzoCU1+Y3k+nmlZ+k8nEj7H2pYCFmXzbP1eEsmhruQ8wXpeZkuaHqcPoN2AwZez/+ RIAYDQAvdT2m1Jgp6oyOOPcldCvapI2xaU8/BlDnu+hYcrRnC1pzHnQlRKuZhPf1vVI3 xzNalODHmYXBpknahVwUHUwgQlk5PdHPXu+4vsM0cSQqkcCmcalFfLJSY28Cd6RdE/w8 e63phyF4CC5/BotNhy7xH+NcU12xkhx1a0OZ5KvDmLDDziV8LT68Zy59yktOxwj3LAsr 4Q8iIJwe5kvHTnBqLmz1ySfmhVSNg98nJYcREJU1w2n5J3/ptEb3PwxQE29IEOr89g+I KF/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ngXSTc5I+kbX2tsoBIw/ypTTw54CR+L8uwvTGmN2r20=; b=PmOtPjmUXrreVXiVKaP53nV31zx4vz7voa8NFnyBMPcuHNytnNZCCFf8VeOcHkb2DS uIeUaigelg7zKHyuLGUk7t72i4WM9BFRY6enkKlaRAGS8FHInzAq+aVh95eYstx5UCiS jnoYAPaOv/iyQ5hkppvBIYxjOOySeeoCYPKPNvhHkH4tXFl6zmXn221pAQsdnnei2Xe+ Ci5Sl18myDH2Nip5ZHv7zlYHAPwCRnjFq6osNCR01F6vJd9GaQgW3iQtxd0XdfsKPk6h VqmJUH1hKpDtGhoZn5tvCORlizbdYAkPibETWB3TOicV+7Bh8aPRSkq6yZ23touNKo0S 26tg== X-Gm-Message-State: AKwxytclbsHTBkbDYjS1cVcXbBRyglYVrbaTQWbNzBNw0Yi/lYsqpQBk SlfILjcl788wFp8UGoOqmHc= X-Google-Smtp-Source: ACJfBoseQOn4t1uTaqM33/Y3YjfhZomnrgjhTQ2fP3NSBN+0IZy3S+F2eh31/BlmNb86QojXyqplIg== X-Received: by 10.233.216.134 with SMTP id u128mr17346352qkf.50.1515432569972; Mon, 08 Jan 2018 09:29:29 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth Date: Mon, 8 Jan 2018 14:28:58 -0300 Message-Id: <20180108172904.8772-7-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 06/12] slirp: remove unused header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Tested-by: Thomas Huth --- slirp/slirp.h | 1 - 1 file changed, 1 deletion(-) diff --git a/slirp/slirp.h b/slirp/slirp.h index 9a7287e7cc..447dc045a8 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -1,7 +1,6 @@ #ifndef SLIRP_H #define SLIRP_H -#include "qemu/host-utils.h" #include "slirp_config.h" #ifdef _WIN32 From patchwork Mon Jan 8 17:28:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ugILNbN0"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFj9n5ybpz9t0m for ; Tue, 9 Jan 2018 04:36:12 +1100 (AEDT) Received: from localhost ([::1]:47007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbLG-0004ZB-3z for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:36:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbEs-0008G7-DE for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbEr-0000Il-Kf for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:34 -0500 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:39645) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbEr-0000IC-Gm for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:33 -0500 Received: by mail-qk0-x244.google.com with SMTP id r8so10802525qke.6 for ; Mon, 08 Jan 2018 09:29:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YMyp4xIYtrvPaT4ydLuJthTDZHUGdH2cpcyW38p4veA=; b=ugILNbN0YhIZ1hYc9AjrVjhC329F5vdJokIUv61rpGm5maKB6ayZsh5A/wE942+MYr 6GqzqC4Bm7Q6gdWloUf+7WlmK5elt0M11pBqK784EtmgJeUkz8WWk3uoUHliCeduGtAh axBxaAZW5s6QJ+9EmgGFHc3kAQYwl/2kUYDG3kccjQLMepgS3fA0cadImlyK05kS4qEN iC3ZXxXrAuSDUN25UlCxqOixfyzJ0xSXV1wYOKTQgiyfx1IS9oDTYtahdWLDIdLzfDJt fy1ghmHzojZOvEXyXPCW+IcX54zeIAsfWKWolmbxeQR+bYIQWOwYof+8n9CbOKYj0uha zzUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=YMyp4xIYtrvPaT4ydLuJthTDZHUGdH2cpcyW38p4veA=; b=VgMLBOyNqeLtYBSCz9s/odq/MPM74A09xc7RNj8clLAmKdRhnw7okfPA5oVeaDE0yc u0y6XwEWNpVOYUijR8mU3Bn2Eokq9JqpEwMuWcK4SaE1ql98QjxqinM//DShsYsL3IbO k3HXePlc8iCGM7YVD5yKQI7WLvHAqFssmjq6kpq7iVLAHUIA3VSuPdJn9+k66d7oq9Wg FMI2TNOqhsp7UGuUgIbuJNU1dDpd6PNrIfycI0Y2hJ7rYm1moIYXY3f1W01FglXF1OHT cYdYKvtNP5mDxtCoOzOLHjWVuGiF+ftQJ2OPBxqr8QtgYnMetwNGsLn9h5I8qoADzl6Y 1sIA== X-Gm-Message-State: AKwxytfZ5j/G3DpxyBrXa0N+Mc0ZB1fzP7RhlCqOHNoZJRHvoILFnaVR rXhrhyAaPx61GpctUz4X/Yk= X-Google-Smtp-Source: ACJfBouk/KjnbTvNRLtKhDk50pl0kOs9vX7Tob/qteIu0bJWSQT3rakasx5t5MW0WnJvrx7aZD4NnQ== X-Received: by 10.55.31.145 with SMTP id n17mr6168137qkh.84.1515432573016; Mon, 08 Jan 2018 09:29:33 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth Date: Mon, 8 Jan 2018 14:28:59 -0300 Message-Id: <20180108172904.8772-8-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 07/12] slirp: remove unnecessary X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- slirp/libslirp.h | 1 - 1 file changed, 1 deletion(-) diff --git a/slirp/libslirp.h b/slirp/libslirp.h index f90f0f524c..540b3e5903 100644 --- a/slirp/libslirp.h +++ b/slirp/libslirp.h @@ -3,7 +3,6 @@ #include "qemu-common.h" -struct Slirp; typedef struct Slirp Slirp; int get_dns_addr(struct in_addr *pdns_addr); From patchwork Mon Jan 8 17:29:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856954 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Vw5JsZgY"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFjBD0QWFz9s74 for ; Tue, 9 Jan 2018 04:36:36 +1100 (AEDT) Received: from localhost ([::1]:47051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbLe-0004vP-59 for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:36:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbEw-0008JK-AJ for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbEv-0000NY-Gp for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:38 -0500 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:41036) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbEv-0000N2-Bp for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:37 -0500 Received: by mail-qt0-x242.google.com with SMTP id i40so14524531qti.8 for ; Mon, 08 Jan 2018 09:29:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z3UGGuHxMO7nrwZA3FHXEWCwJRaSgfs3MpLjB6PXzl4=; b=Vw5JsZgYDrQm2Lb1hGHJHlCg7lCcLdOHKzX8z8iGyZ8Dd7iuYQdioh6gNxIeczR8sW PtKLp/kft39yf9Y1Fxf7m61INYlmjxsyGIVT7XPpAC93IaQZGcUh0UlcAuGUtY6z116b nJX/CENZo8Unhew23PcHHhyn8y/aPBV3mKN58ROLxqgtPd3CAWkPt50yy/opI28Yycko +olAfmVUU0PgZugClTRkXggl0EP0kdF+HgdjCT3POKCeBx+ZxSYLyHhQtJMLE661XXyk tpOZF3RqO7MUfmK5TqLCDhTblLPbMbZsIxF5M9b+8U3tDY49E1Ah3udcxKX17sRkyboS Sy2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Z3UGGuHxMO7nrwZA3FHXEWCwJRaSgfs3MpLjB6PXzl4=; b=e65r6eZ+ZltqbKuzGicO5+bP8ghwGGs31haFoRTL22HSFHaaFpFwMIP3p46z3NFj5y yC9Tt9lEoAtMNgnjRRF043OOwrqgPqlV09phnY5kQvEeKtNzwBbiN4oI6e2isOwe25q5 0igyZrt94JBD1EH8/0PhAitfgZ2U3LM5klHlaHst3xIz8EZ9IPQfN7SSBmOfgz4BXayi 7VzJ+svLMRTW5kq5al1Gz9YzOUuRF8A8Nefnb4NogzHtqFW/JWKtIGYanvMjF9pH4N4L zuaQzf7kdZEp3aAbQIfWU7SWSSS1ti+mV3srg2w3FahTgcNk0s2rUikHQy6KHtj6mSoN yBVg== X-Gm-Message-State: AKwxytcWAZy20ketxhEikkL+w3stNYRNKyIN8sTibOKyB48fv9GVozRj Fb41MAQw/c1VXazPAz9lIdI= X-Google-Smtp-Source: ACJfBouuwE/Br/b6verqOSo6/3gDU6M5hvUZ4wYZ1kMWnfaD8ieoIY5KMqExVHmjjfu5bTphYd3N0g== X-Received: by 10.200.41.6 with SMTP id y6mr16058279qty.219.1515432576640; Mon, 08 Jan 2018 09:29:36 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth Date: Mon, 8 Jan 2018 14:29:00 -0300 Message-Id: <20180108172904.8772-9-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 08/12] slirp: removed unused code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- slirp/ip.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/slirp/ip.h b/slirp/ip.h index e29ccd3c9f..71c3642cfe 100644 --- a/slirp/ip.h +++ b/slirp/ip.h @@ -233,17 +233,4 @@ struct ipasfrag { #define ipf_next ipf_link.next #define ipf_prev ipf_link.prev -/* - * Structure stored in mbuf in inpcb.ip_options - * and passed to ip_output when ip options are in use. - * The actual length of the options (including ipopt_dst) - * is in m_len. - */ -#define MAX_IPOPTLEN 40 - -struct ipoption { - struct in_addr ipopt_dst; /* first-hop dst if source routed */ - int8_t ipopt_list[MAX_IPOPTLEN]; /* options proper */ -} QEMU_PACKED; - #endif From patchwork Mon Jan 8 17:29:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WwpqElLK"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFjBG4vCvz9s4s for ; Tue, 9 Jan 2018 04:36:38 +1100 (AEDT) Received: from localhost ([::1]:47055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbLg-0004x7-Nt for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:36:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbF1-0008OM-Bw for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbEy-0000S1-9z for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:43 -0500 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:42952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbEy-0000RH-5t for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:40 -0500 Received: by mail-qt0-x242.google.com with SMTP id g9so14527374qth.9 for ; Mon, 08 Jan 2018 09:29:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lzR3BnBGzDQc+mwz9m0/uCn7V/pve6ifieXjW07UBkQ=; b=WwpqElLK6zzmQTCH5kgCFH439HrVPsNHyby5xufuvJ2LLAt3ZnkAWFBCW1p6DbFuaS UVC4oXkFoRTFdK1Z+1eS715QvMZQ2ATnjuEtgTkgKeBnpOOkHn23zR3J0W7aLbxxTgzn qUdFG1/YR5QmRKGNag+cLAIZdqaeCTILuxih+sRQiHc/EVC2/LhieIFLBoJTDAyaROfE OmrR+CSQsEmjYv/DQAzOXCdcBa9nmsDOE2g8ZqN6e8cBLTKHgCfVBsZ14V80xI4ES7Hv tVSe1WyzWlCL9icjLBVUtFSCGeV2+YR6YEadHmpO5DALTEAg3gclB1nPIJcSmKC57Rpo I3uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=lzR3BnBGzDQc+mwz9m0/uCn7V/pve6ifieXjW07UBkQ=; b=CElFLDvsKgjMRLQfqpCmsfjnKeeWoBXSUapjl/TyOIe1Awp0/fJsqUq3T1wsK3PZWn Vk7pW+nMfYSoJNeGPOiVvMZ4ioeuVhp5VnLtxngQ3limYjbRcIMO4zdnAwsgnDmEogyT zYek9W1LyvcVNtkXLPLz0F6MSZq76Dd64WUbhd8WlIvEGWBj55xqO4DT2MpX1+ozWYhU 7Fvh4+MW4n3E3Hv8Cu8BxKIXxYmsbY/+dzAP8vM1lvLIKYXi3325yTz6i5lLXaWcTwF8 AP44MXum89b2cjpDF0QJV2j9WlU1R0CAUqxvffz7cHgNcM7rHNd/ADNJjoks9xYXshIP sYkw== X-Gm-Message-State: AKwxyteYEQyJRswXRWVNMDSSKKgFGcevEdfZxUvvY4uQ3u7P/LqjMGVf vB2w9ptca8Wggo/aalfIhAQ= X-Google-Smtp-Source: ACJfBour8ZEH9O3IenLi/R6l1D4fxXPxg51T26clUoVWMA3IbCnPQ/f2oiGqfkRCmTDgKBLVqjpqoQ== X-Received: by 10.200.56.247 with SMTP id g52mr17416527qtc.10.1515432579741; Mon, 08 Jan 2018 09:29:39 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth Date: Mon, 8 Jan 2018 14:29:01 -0300 Message-Id: <20180108172904.8772-10-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 09/12] slirp: add in6_dhcp_multicast() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- slirp/dhcpv6.h | 3 +++ slirp/udp6.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/slirp/dhcpv6.h b/slirp/dhcpv6.h index 9189cd3f2d..3373f6cb89 100644 --- a/slirp/dhcpv6.h +++ b/slirp/dhcpv6.h @@ -17,6 +17,9 @@ 0x00, 0x00, 0x00, 0x00,\ 0x00, 0x01, 0x00, 0x02 } } +#define in6_dhcp_multicast(a)\ + in6_equal(a, &(struct in6_addr)ALLDHCP_MULTICAST) + void dhcpv6_input(struct sockaddr_in6 *srcsas, struct mbuf *m); #endif diff --git a/slirp/udp6.c b/slirp/udp6.c index 9fa314bc2d..7c4a6b003a 100644 --- a/slirp/udp6.c +++ b/slirp/udp6.c @@ -65,7 +65,7 @@ void udp6_input(struct mbuf *m) /* handle DHCPv6 */ if (ntohs(uh->uh_dport) == DHCPV6_SERVER_PORT && (in6_equal(&ip->ip_dst, &slirp->vhost_addr6) || - in6_equal(&ip->ip_dst, &(struct in6_addr)ALLDHCP_MULTICAST))) { + in6_dhcp_multicast(&ip->ip_dst))) { m->m_data += iphlen; m->m_len -= iphlen; dhcpv6_input(&lhost, m); From patchwork Mon Jan 8 17:29:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856961 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Q37zEEqZ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFjFG3jsZz9s74 for ; Tue, 9 Jan 2018 04:39:14 +1100 (AEDT) Received: from localhost ([::1]:47188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbOC-0007Uc-LN for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:39:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbF2-0008PZ-LH for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbF1-0000Y2-R4 for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:44 -0500 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:36061) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbF1-0000X9-Nv for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:43 -0500 Received: by mail-qk0-x244.google.com with SMTP id d21so4111676qkj.3 for ; Mon, 08 Jan 2018 09:29:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FHt3LXj3/ujH6iKI6UXvFDzKf/c68Lgcjb2ThxndyQw=; b=Q37zEEqZppGla4wxwfs6vWrHLDoRcztM1YXeDlhdwSzh8yfQQdUus+l1aAxTHPqq0y QsD0BZg5SmXi9tPd3iYz8vyW1C7e0Q3QEfzWZcoelKpQocUxhUDLEsP5Aa0Nu0XChgHc XMgCTgZDJqjCbP6p25zYUbCsV/8tTcpv+iXRJQyut9/cqJY0LEAcGeDNM8jm8eKfC7bY tvalmqEE0v/N3Y+V/vt9oxja0OlW4516tcvit5A282cfxacP2Y/u8u4y469Q1jK1HlB8 CA+GLSTZBP1tLAUKpJhQbTRzt4SjPO8DxJ0QSxIWFvTsjhqKN7Cot9Q65inmhBSbSumQ PIKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=FHt3LXj3/ujH6iKI6UXvFDzKf/c68Lgcjb2ThxndyQw=; b=ZyyDCSHzMnn/k+XrbB04NkNCQ/bKXjjsVie8cSd2PiQy/64IOAfmOsPcz2IA8YY8eq /NryZsVvU36SvK2V7DL/7EYxENaJvzosPsNWQb/6kWZugkSOZpYjJHCwulgBPDsAlw4a ocHhX3hBGxyCPt1gIqhyAhG+C/LFW4vzRcwbDfV31nEnhh6uDdwVccLhofvdGkOvwNgw 5Zxi3iC0eYSGgjJ2HUoeZqQ/7BeBfDTNKhD71KRKac2lPDfTXAU/v6FkOVTXm3bupSJI O5ZvlX3lFltC2oY5Ck5X0ZIqG2It/hZBp/efGDWkQjiHa9xdvRvAqe7TxCZgT2OdoBY7 TdCA== X-Gm-Message-State: AKwxytf2/vW4Dz8+hoaNLiFx3Rasv19HwJ3zZnKERbHa66hTEqP1EpXc gWHA+HYhmcZx4UwJTVx3UZ5YwPjI9rg= X-Google-Smtp-Source: ACJfBosjUZOzoZrgzO4M/IFqccCrBZqp8VH4Oev4peL3t/JU611Biz6coEiyY6JafBNtZFd+nlVAHw== X-Received: by 10.55.212.129 with SMTP id s1mr17926885qks.44.1515432583310; Mon, 08 Jan 2018 09:29:43 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth , Peter Maydell Date: Mon, 8 Jan 2018 14:29:02 -0300 Message-Id: <20180108172904.8772-11-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 10/12] configure: disable unaligned access warning on x86 arch X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- configure | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/configure b/configure index 56f9716609..28cd073941 100755 --- a/configure +++ b/configure @@ -276,6 +276,7 @@ cc_i386=i386-pc-linux-gnu-gcc libs_qga="" debug_info="yes" stack_protector="" +host_supports_unaligned_access="no" if test -e "$source_path/.git" then @@ -692,6 +693,13 @@ if test -z "$ARCH"; then ARCH="$cpu" fi +# ARCH specific +case "$ARCH" in + i386|x86_64) + host_supports_unaligned_access="yes" + ;; +esac + # OS specific # host *BSD for user mode @@ -4993,6 +5001,15 @@ if test "$fortify_source" != "no"; then fi fi +################################################# +# check if host supports unaligned access + +if test "$host_supports_unaligned_access" != "no"; then + if compile_prog "-Werror -Wno-address-of-packed-member" "" ; then + QEMU_CFLAGS="-Wno-address-of-packed-member $QEMU_CFLAGS" + fi +fi + ########################################## # check if struct fsxattr is available via linux/fs.h From patchwork Mon Jan 8 17:29:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856949 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AlCH1CE0"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFj6f3lgCz9sNV for ; Tue, 9 Jan 2018 04:33:30 +1100 (AEDT) Received: from localhost ([::1]:46985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbIe-0002EM-GN for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:33:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbF5-0008Sh-Nf for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbF4-0000d1-W8 for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:47 -0500 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:41378) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbF4-0000ce-RO for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:46 -0500 Received: by mail-qk0-x241.google.com with SMTP id a8so15091898qkb.8 for ; Mon, 08 Jan 2018 09:29:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h7X4SL4hMkCxsQQ/3ZqtXUqwpkl16fQgdU6EtDKxzJo=; b=AlCH1CE0TFURgMknJIaLfou/eyKFcKsIINKR/7kGHcUeiy1jgnurEAgDDBpok82PjF U4oCGE4rsROUojljv1V/EHI8cBRWxEKSKbIV9S/JBH2Cr6EArWS5PmlrVEjMJRQt0KnK bwBCDyR+ekNVHVykfF723f74a+9wZgTC1A4wFiXCI/Gly1ZcBcVr4jWbBNL3bToc6wkr qw7WVPzqmDj2MVj8s6zcN6sPbg+7svzCrrd9vt9GDzfHigFF3p3+CRUAW1GgKwASv8sP MXUUGSiAPfBsStdJ4oUFH/72vTS9YpkJ36X7bU+4r11tfnt0QuyqbYN8zFPPI9mXvW/p 8t9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=h7X4SL4hMkCxsQQ/3ZqtXUqwpkl16fQgdU6EtDKxzJo=; b=fwHbnMQoNsorVPMhDNDIQ1r99+grJLgdwWjHLNlR/IUaoEVoq12XuaxmHjYBu5MX2n uIZQ/z8f1h2FzqoXER4kwl+3b2w9APduTQeGfusVzp8ONnW3Psnblpx6jWAo5JISXht6 mHoc2CaPvLymeuNbCDsVZ0ibxS2BjRXpFljjRaOnIAkKeROrR2ci6AWPB1mJ/mv3/oOa ZsRJvLuL+C2lVLaoyqLXE4KquR2sSxP1F/i3f5A90vfKKOSJhN2fQIeRceK0LDtZZW6t YG9ic7zGb6D34GHgFpIdVo6tVrWZdNXI3GkCOU852YhQe33VJtoeT4RDj1j5V7MotjM8 J9Bg== X-Gm-Message-State: AKwxytdxDZmuQvRNQqRP2ahDVKAUkYmjOUM8eHt9J7Zs3QHSLK3I8Fvq MNPHH/oP2YOBehXBmnRdopZf35fG X-Google-Smtp-Source: ACJfBotOzjAiNgXVpLcHAx9ZPHRUf0Y4aahBU23L1myCiB90Er2cEflkRK849aY/BJOJLYqoRuOIXA== X-Received: by 10.55.16.90 with SMTP id a87mr17462406qkh.35.1515432586418; Mon, 08 Jan 2018 09:29:46 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth Date: Mon, 8 Jan 2018 14:29:03 -0300 Message-Id: <20180108172904.8772-12-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 11/12] configure: add HOST_SUPPORTS_UNALIGNED_ACCESS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 28cd073941..669e5a041a 100755 --- a/configure +++ b/configure @@ -5005,6 +5005,7 @@ fi # check if host supports unaligned access if test "$host_supports_unaligned_access" != "no"; then + QEMU_CFLAGS="-DHOST_SUPPORTS_UNALIGNED_ACCESS $QEMU_CFLAGS" if compile_prog "-Werror -Wno-address-of-packed-member" "" ; then QEMU_CFLAGS="-Wno-address-of-packed-member $QEMU_CFLAGS" fi From patchwork Mon Jan 8 17:29:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856960 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X2lQrvF/"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFjFF1sggz9s4s for ; Tue, 9 Jan 2018 04:39:13 +1100 (AEDT) Received: from localhost ([::1]:47171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbOB-0007SO-Ci for incoming@patchwork.ozlabs.org; Mon, 08 Jan 2018 12:39:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYbFB-00006J-LN for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYbF8-0000ht-G9 for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:53 -0500 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:44501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYbF8-0000hO-CU for qemu-devel@nongnu.org; Mon, 08 Jan 2018 12:29:50 -0500 Received: by mail-qk0-x243.google.com with SMTP id v188so15086157qkh.11 for ; Mon, 08 Jan 2018 09:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WI+9i6Ed0QWaQh8rKK0RExXr90jMLMJ1cDrZWoVgPFE=; b=X2lQrvF/U883cbDckqPPJfMHfoGC7Xvr+fq3faVGdMb5j+WuAofXUth1yj8dps4Yp8 40ictUE/ngCPojHZZ7wOWfFz0XECj+eanbwrYcOpgO/xm9bnIN7NNgZOX454RuSsm8kz eABZ1Ju5+pSJSFKEPPD/dzaMa3TwsWUUPKmz7iV6Ybi/UpqBVSkAjJwD5c7g50TZm9P9 RdD+lPU6FF8wS0xp7KR+RiRDudIFVgR3gqkH2ESKQcleEx1s/WwzSDoxVWEzituVUm0z sI6LMc0wscoLcer6uJjol6eSOlXaL53uR97qGUUn2l2CIHHJT22CBNJo6IVz9ZrrPFob 4aFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=WI+9i6Ed0QWaQh8rKK0RExXr90jMLMJ1cDrZWoVgPFE=; b=mexXHC9RFc66npTuFWfixiqXEip28HBx7wHz/72/tikhdtwh3OlXG5ykQpSQ0ZcmMN H3yxUQqyEEV4EnJM/AWhJisbSy20godMtYNaiJQgsPvfyIO7QAHE0Xt7bWjnLKCq/INy S0TNMhqKoTd8PLzJbYdSG0JAyFCX5PRr06RVyFDcFYt3rpfXhST45pwE8p6RRWp4CGma eruARg1EXwLQLcsQhaet2emXjQKAFAINJSYcVOHN3kAplxn+HBSUjzlaLGHffTX0x2mE ZM7Vryq8vZrgKjfrJClJiWh38tP9ijNFDNUszO1BvG77S+AwUK2Sv2n9YCAyOp9vIai7 +rlg== X-Gm-Message-State: AKwxytephYcTgIbQqEnUiCDU81VclFff3S0i6sgz+DGlHDXmGH06/ll1 EHSLv8hKNM6ZVdi+rLTxgCA= X-Google-Smtp-Source: ACJfBosk9c/Pp6b8TiXqqIRcRsMd7f7cUH+7G2pRC6Le8J5LPkzjiz96tlw+HLYIBiOowNIV45ZJpQ== X-Received: by 10.55.53.80 with SMTP id c77mr17744479qka.1.1515432589931; Mon, 08 Jan 2018 09:29:49 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id j127sm787922qkd.88.2018.01.08.09.29.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jan 2018 09:29:49 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Samuel Thibault , Jan Kiszka , "Michael S . Tsirkin" , Paolo Bonzini , Eric Blake , Thomas Huth , Richard Henderson , Peter Maydell Date: Mon, 8 Jan 2018 14:29:04 -0300 Message-Id: <20180108172904.8772-13-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108172904.8772-1-f4bug@amsat.org> References: <20180108172904.8772-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [RFC PATCH 12/12] slirp: use HOST_SUPPORTS_UNALIGNED_ACCESS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Access struct in6_addr with 'void *', then cast to 'u8 *' to avoid alignment issues. Signed-off-by: Philippe Mathieu-Daudé --- ugly... slirp/ip6.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/slirp/ip6.h b/slirp/ip6.h index c6493a0856..4eaeaa9a0a 100644 --- a/slirp/ip6.h +++ b/slirp/ip6.h @@ -51,11 +51,19 @@ 0x00, 0x00, 0x00, 0x00,\ 0x00, 0x00, 0x00, 0x00 } } +#ifdef HOST_SUPPORTS_UNALIGNED_ACCESS static inline bool in6_equal(const struct in6_addr *a, const struct in6_addr *b) { return memcmp(a, b, sizeof(*a)) == 0; } +#else +static inline bool in6_equal(const void *a, const void *b) +{ + return memcmp(a, b, sizeof(struct in6_addr)) == 0; +} +#endif +#ifdef HOST_SUPPORTS_UNALIGNED_ACCESS static inline bool in6_equal_net(const struct in6_addr *a, const struct in6_addr *b, int prefix_len) @@ -71,7 +79,28 @@ static inline bool in6_equal_net(const struct in6_addr *a, return a->s6_addr[prefix_len / 8] >> (8 - (prefix_len % 8)) == b->s6_addr[prefix_len / 8] >> (8 - (prefix_len % 8)); } +#else +static inline bool in6_equal_net(const void *a, + const void *b, + int prefix_len) +{ + const uint8_t *aa = (uint8_t *)a; + const uint8_t *ab = (uint8_t *)b; + + if (memcmp(a, b, prefix_len / 8) != 0) { + return 0; + } + + if (prefix_len % 8 == 0) { + return 1; + } + + return (aa[prefix_len / 8] >> (8 - (prefix_len % 8))) + == (ab[prefix_len / 8] >> (8 - (prefix_len % 8))); +} +#endif +#ifdef HOST_SUPPORTS_UNALIGNED_ACCESS static inline bool in6_equal_mach(const struct in6_addr *a, const struct in6_addr *b, int prefix_len) @@ -89,6 +118,28 @@ static inline bool in6_equal_mach(const struct in6_addr *a, return (a->s6_addr[prefix_len / 8] & ((1U << (8 - (prefix_len % 8))) - 1)) == (b->s6_addr[prefix_len / 8] & ((1U << (8 - (prefix_len % 8))) - 1)); } +#else +static inline bool in6_equal_mach(const void *a, + const void *b, + int prefix_len) +{ + const uint8_t *aa = (uint8_t *)a; + const uint8_t *ab = (uint8_t *)b; + + if (memcmp(&(aa[DIV_ROUND_UP(prefix_len, 8)]), + &(ab[DIV_ROUND_UP(prefix_len, 8)]), + 16 - DIV_ROUND_UP(prefix_len, 8)) != 0) { + return 0; + } + + if (prefix_len % 8 == 0) { + return 1; + } + + return (aa[prefix_len / 8] & ((1U << (8 - (prefix_len % 8))) - 1)) + == (ab[prefix_len / 8] & ((1U << (8 - (prefix_len % 8))) - 1)); +} +#endif #define in6_equal_router(a)\ @@ -112,10 +163,17 @@ static inline bool in6_equal_mach(const struct in6_addr *a, #define in6_zero(a)\ (in6_equal(a, &(struct in6_addr)ZERO_ADDR)) +#ifdef HOST_SUPPORTS_UNALIGNED_ACCESS static inline bool in6_multicast(const struct in6_addr *a) { return a->s6_addr[0] == 0xff; } +#else +static inline bool in6_multicast(const void *a) +{ + return ((const uint8_t *)a)[0] == 0xff; +} +#endif /* Compute emulated host MAC address from its ipv6 address */ static inline void in6_compute_ethaddr(struct in6_addr ip,