From patchwork Mon Aug 15 08:24:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9280423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E88A460839 for ; Mon, 15 Aug 2016 08:25:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D38F128BAD for ; Mon, 15 Aug 2016 08:25:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5CD828BCB; Mon, 15 Aug 2016 08:25:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0EE6D28BAD for ; Mon, 15 Aug 2016 08:25:31 +0000 (UTC) Received: from localhost ([::1]:35478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZDD8-0004xp-7Q for patchwork-qemu-devel@patchwork.kernel.org; Mon, 15 Aug 2016 04:25:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZDCg-0004w9-I6 for qemu-devel@nongnu.org; Mon, 15 Aug 2016 04:25:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZDCc-0003hk-9j for qemu-devel@nongnu.org; Mon, 15 Aug 2016 04:25:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZDCc-0003hf-4I; Mon, 15 Aug 2016 04:24:58 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C0DB8553C; Mon, 15 Aug 2016 08:24:57 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7F8Ot1d027648; Mon, 15 Aug 2016 04:24:55 -0400 From: Thomas Huth To: qemu-devel@nongnu.org, samuel.thibault@ens-lyon.org Date: Mon, 15 Aug 2016 10:24:54 +0200 Message-Id: <1471249494-17392-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 15 Aug 2016 08:24:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-2.7] slirp: Rename "struct arphdr" to "struct slirp_arphdr" 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: qemu-trivial@nongnu.org, pbonzini@redhat.com, brad@comstyle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP struct arphdr is already used by the system headers on OpenBSD and thus QEMU does not compile here anymore. Fix it by renaming our struct to slirp_arphdr instead. Reported-by: Brad Smith Buglink: https://bugs.launchpad.net/qemu/+bug/1613133 Signed-off-by: Thomas Huth Reviewed-by: Samuel Thibault --- slirp/slirp.c | 10 +++++----- slirp/slirp.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/slirp/slirp.c b/slirp/slirp.c index 47a1652..d67eda1 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -773,10 +773,10 @@ void slirp_pollfds_poll(GArray *pollfds, int select_error) static void arp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) { - struct arphdr *ah = (struct arphdr *)(pkt + ETH_HLEN); - uint8_t arp_reply[max(ETH_HLEN + sizeof(struct arphdr), 64)]; + struct slirp_arphdr *ah = (struct slirp_arphdr *)(pkt + ETH_HLEN); + uint8_t arp_reply[max(ETH_HLEN + sizeof(struct slirp_arphdr), 64)]; struct ethhdr *reh = (struct ethhdr *)arp_reply; - struct arphdr *rah = (struct arphdr *)(arp_reply + ETH_HLEN); + struct slirp_arphdr *rah = (struct slirp_arphdr *)(arp_reply + ETH_HLEN); int ar_op; struct ex_list *ex_ptr; @@ -890,9 +890,9 @@ static int if_encap4(Slirp *slirp, struct mbuf *ifm, struct ethhdr *eh, return 1; } if (!arp_table_search(slirp, iph->ip_dst.s_addr, ethaddr)) { - uint8_t arp_req[ETH_HLEN + sizeof(struct arphdr)]; + uint8_t arp_req[ETH_HLEN + sizeof(struct slirp_arphdr)]; struct ethhdr *reh = (struct ethhdr *)arp_req; - struct arphdr *rah = (struct arphdr *)(arp_req + ETH_HLEN); + struct slirp_arphdr *rah = (struct slirp_arphdr *)(arp_req + ETH_HLEN); if (!ifm->resolution_requested) { /* If the client addr is not known, send an ARP request */ diff --git a/slirp/slirp.h b/slirp/slirp.h index 624a850..a1f3139 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -105,7 +105,7 @@ struct ethhdr { unsigned short h_proto; /* packet type ID field */ }; -struct arphdr { +struct slirp_arphdr { unsigned short ar_hrd; /* format of hardware address */ unsigned short ar_pro; /* format of protocol address */ unsigned char ar_hln; /* length of hardware address */ @@ -124,7 +124,7 @@ struct arphdr { #define ARP_TABLE_SIZE 16 typedef struct ArpTable { - struct arphdr table[ARP_TABLE_SIZE]; + struct slirp_arphdr table[ARP_TABLE_SIZE]; int next_victim; } ArpTable;