summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/tap-bsd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index ac84383f0f..bde2083e57 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -59,6 +59,17 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required
dev = devname(s.st_rdev, S_IFCHR);
pstrcpy(ifname, ifname_size, dev);
+ if (*vnet_hdr) {
+ /* BSD 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;
}