From patchwork Fri Oct 7 01:28:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Smith X-Patchwork-Id: 9365563 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 012C8607D3 for ; Fri, 7 Oct 2016 01:29:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D32712929A for ; Fri, 7 Oct 2016 01:29:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C76672929C; Fri, 7 Oct 2016 01:29:09 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 7D5642929A for ; Fri, 7 Oct 2016 01:29:08 +0000 (UTC) Received: from localhost ([::1]:60161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsJyE-0006rU-Dh for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Oct 2016 21:29:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsJxz-0006rL-U8 for qemu-devel@nongnu.org; Thu, 06 Oct 2016 21:28:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsJxx-0001Ew-Lk for qemu-devel@nongnu.org; Thu, 06 Oct 2016 21:28:50 -0400 Received: from speedy.comstyle.com ([2001:470:1d:8c::2]:36436 helo=mail.comstyle.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsJxx-00010V-FQ for qemu-devel@nongnu.org; Thu, 06 Oct 2016 21:28:49 -0400 Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id B8C489882E; Thu, 6 Oct 2016 21:28:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=comstyle.com; h=date:from :to:subject:message-id:mime-version:content-type; s=selector1; bh=McFpcrjy7I7njKqiIz2If9ESjhc=; b=FXI+xzPkk5dte49RKaJ681ZgYIwa DAjmVJiA6TtpTWFEQ1LSOProI+9xR1W5mUdC1LdRXVcOctB1poOQEsrv5dEQqU8F BIB7bx+sNSB+9pzZRb6DamxLkhiXxIh/7lwa811i1EdwRv8+s4SkhWZagGRtRbEh idjqJtJ5fh4HcsY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=comstyle.com; h=date:from:to :subject:message-id:mime-version:content-type; q=dns; s= selector1; b=egyE+qoyR+bKCL6flm6LQi71poPYKwWUK64Cwcr4J8ZZb18dcxx 2L1jliZsxcgiQ9KpJwILL0KrCI/6FV5jI8l6ewBEgXBZDjAEAFEAYpvpJ9+Fsh9b wqENyfhgSyxfTPRwcrtQnSK2SOnLRI4FBnCWUqBMRpf5ArpBU/0Wddc0= Received: from humpty.home.comstyle.com (unknown [IPv6:2001:470:b01e:3:6c0a:d0ee:c697:8e46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 67FF69882D; Thu, 6 Oct 2016 21:28:34 -0400 (EDT) Date: Thu, 6 Oct 2016 21:28:33 -0400 From: Brad Smith To: qemu-devel@nongnu.org, jasowang@redhat.com Message-ID: <20161007012832.nfv2ctxri3z76pnp@humpty.home.comstyle.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20161003 (1.7.0) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:470:1d:8c::2 Subject: [Qemu-devel] [PATCH v2] tap-bsd: OpenBSD uses tap(4) now 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Update the tap-bsd code now that OpenBSD uses tap(4). Signed-off-by: Brad Smith --- v2: Allow the code to deal with newer vs older OpenBSD releases diff --git a/net/tap-bsd.c b/net/tap-bsd.c index c506ac3..6c96922 100644 --- a/net/tap-bsd.c +++ b/net/tap-bsd.c @@ -35,6 +35,10 @@ #include #endif +#if defined(__OpenBSD__) +#include +#endif + #ifndef __FreeBSD__ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required, int mq_required, Error **errp) @@ -55,7 +59,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, if (*ifname) { snprintf(dname, sizeof dname, "/dev/%s", ifname); } else { -#if defined(__OpenBSD__) +#if defined(__OpenBSD__) && OpenBSD < 201605 snprintf(dname, sizeof dname, "/dev/tun%d", i); #else snprintf(dname, sizeof dname, "/dev/tap%d", i);