From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx369-0001Ig-Mb for qemu-devel@nongnu.org; Wed, 19 Oct 2016 22:28:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bx365-0003W9-34 for qemu-devel@nongnu.org; Wed, 19 Oct 2016 22:28:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55538) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bx364-0003Vs-UB for qemu-devel@nongnu.org; Wed, 19 Oct 2016 22:28:45 -0400 References: <20161007012832.nfv2ctxri3z76pnp@humpty.home.comstyle.com> From: Jason Wang Message-ID: <6b1dacda-a29e-095a-6086-65caa07fb433@redhat.com> Date: Thu, 20 Oct 2016 10:28:38 +0800 MIME-Version: 1.0 In-Reply-To: <20161007012832.nfv2ctxri3z76pnp@humpty.home.comstyle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] tap-bsd: OpenBSD uses tap(4) now List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Brad Smith , qemu-devel@nongnu.org On 2016=E5=B9=B410=E6=9C=8807=E6=97=A5 09:28, Brad Smith wrote: > 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 > =20 > +#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); Applied, thanks.