From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDNqW-0007oY-HV for qemu-devel@nongnu.org; Wed, 25 Nov 2009 14:48:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDNqR-0007jt-Kh for qemu-devel@nongnu.org; Wed, 25 Nov 2009 14:48:11 -0500 Received: from [199.232.76.173] (port=46637 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDNqR-0007jj-Cp for qemu-devel@nongnu.org; Wed, 25 Nov 2009 14:48:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33431) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDNqQ-0006E4-NB for qemu-devel@nongnu.org; Wed, 25 Nov 2009 14:48:07 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAPIqQAQ023393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Nov 2009 13:52:26 -0500 From: Mark McLoughlin Date: Wed, 25 Nov 2009 18:49:37 +0000 Message-Id: <1259174977-26212-45-git-send-email-markmc@redhat.com> In-Reply-To: <1259174977-26212-1-git-send-email-markmc@redhat.com> References: <1259174977-26212-1-git-send-email-markmc@redhat.com> Subject: [Qemu-devel] [PATCH 44/44] net: fix vnet_hdr handling in solaris tap code List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Mark McLoughlin Print an error if the user specifies vnet_hdr=1 on the cmdline. Signed-off-by: Mark McLoughlin --- net/tap-solaris.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/net/tap-solaris.c b/net/tap-solaris.c index ef4e60c..e14fe36 100644 --- a/net/tap-solaris.c +++ b/net/tap-solaris.c @@ -180,6 +180,17 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required return -1; } pstrcpy(ifname, ifname_size, dev); + if (*vnet_hdr) { + /* Solaris doesn't have IFF_VNET_HDR */ + *vnet_hdr = 0; + + if (vnet_hdr_required && !*vnet_hdr) { + qemu_error("vnet_hdr=1 requested, but no kernel " + "support for IFF_VNET_HDR available"); + close(fd); + return -1; + } + } fcntl(fd, F_SETFL, O_NONBLOCK); return fd; } -- 1.6.5.2