summaryrefslogtreecommitdiff
path: root/net/tap-linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tap-linux.c')
-rw-r--r--net/tap-linux.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/tap-linux.c b/net/tap-linux.c
index 6c3b6e311b..0059404069 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -99,3 +99,15 @@ int tap_set_sndbuf(int fd, QemuOpts *opts)
}
return 0;
}
+
+int tap_probe_vnet_hdr(int fd)
+{
+ struct ifreq ifr;
+
+ if (ioctl(fd, TUNGETIFF, &ifr) != 0) {
+ qemu_error("TUNGETIFF ioctl() failed: %s\n", strerror(errno));
+ return 0;
+ }
+
+ return ifr.ifr_flags & IFF_VNET_HDR;
+}