summaryrefslogtreecommitdiff
path: root/net/tap-solaris.c
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-11-25 18:49:37 +0000
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 09:41:35 -0600
commitf5c5e38179aff8cc9bb8bd4c9fe42966f0e9f9fd (patch)
treece04b7069c6705e34b197d95568fb77db718babc /net/tap-solaris.c
parentdf6c2a0fb2f498f488a391c5da13e7cd4de5083e (diff)
downloadqemu-f5c5e38179aff8cc9bb8bd4c9fe42966f0e9f9fd.tar.gz
net: fix vnet_hdr handling in solaris tap code
Print an error if the user specifies vnet_hdr=1 on the cmdline. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net/tap-solaris.c')
-rw-r--r--net/tap-solaris.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index ef4e60c878..e14fe36fdb 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;
}