diff --git a/net/tap-aix.c b/net/tap-aix.c index 3f9ccddda7ca8395d7528a13e1a392840c6776e4..27143ff36b0bbe00b3d249a9885be6d90533e317 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 e28615fba9679476ea3b634742ea66e0f520fde8..1cdde90009fce278a42b90a7ed51f5a6cf8588b4 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 6c3b6e311b4f2fb4a890cde5acd9e2823fe75876..0059404069f9ece747e2e8da90f053ce348cb2e3 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 de5855aa06d2ae3f4b6fe877cb6513b945657f7c..3f48e573289e9cabc024f65169ef8d5556e0ec9e 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 df2cfbe13c308b2375e8651b816460df31aba3f5..3f6722ea6cf1cffe9d5298cb9b40f6ebb956cb0b 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 0d67c249cffbc36f934d86cb676e5dfb56156554..de729a79dbc5640c6cdc73a743af0fef1ad27a12 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 */