aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/tap-aix.c4
-rw-r--r--net/tap-bsd.c5
-rw-r--r--net/tap-linux.c12
-rw-r--r--net/tap-solaris.c5
-rw-r--r--net/tap.c12
-rw-r--r--net/tap.h1
6 files changed, 27 insertions, 12 deletions
diff --git a/net/tap-aix.c b/net/tap-aix.c
index 3f9ccddda7..27143ff36b 100644
--- a/net/tap-aix.c
+++ b/net/tap-aix.c
@@ -36,3 +36,7 @@ int tap_set_sndbuf(int fd, QemuOpts *opts)
return 0;
}
+int tap_probe_vnet_hdr(int fd)
+{
+ return 0;
+}
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index e28615fba9..1cdde90009 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -65,3 +65,8 @@ int tap_set_sndbuf(int fd, QemuOpts *opts)
{
return 0;
}
+
+int tap_probe_vnet_hdr(int fd)
+{
+ return 0;
+}
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;
+}
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index de5855aa06..3f48e57328 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -188,3 +188,8 @@ int tap_set_sndbuf(int fd, QemuOpts *opts)
{
return 0;
}
+
+int tap_probe_vnet_hdr(int fd)
+{
+ return 0;
+}
diff --git a/net/tap.c b/net/tap.c
index df2cfbe13c..3f6722ea6c 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -239,18 +239,6 @@ void tap_using_vnet_hdr(VLANClientState *vc, int using_vnet_hdr)
s->using_vnet_hdr = using_vnet_hdr;
}
-static 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;
-}
-
void tap_set_offload(VLANClientState *vc, int csum, int tso4,
int tso6, int ecn, int ufo)
{
diff --git a/net/tap.h b/net/tap.h
index 0d67c249cf..de729a79db 100644
--- a/net/tap.h
+++ b/net/tap.h
@@ -44,5 +44,6 @@ void tap_using_vnet_hdr(VLANClientState *vc, int using_vnet_hdr);
void tap_set_offload(VLANClientState *vc, int csum, int tso4, int tso6, int ecn, int ufo);
int tap_set_sndbuf(int fd, QemuOpts *opts);
+int tap_probe_vnet_hdr(int fd);
#endif /* QEMU_NET_TAP_H */