mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
net: move tap_probe_vnet_hdr() to tap-linux.c
Only Linux has support for IFF_VNET_HDR Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
15ac913bfe
commit
dc69004c7d
6 changed files with 27 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue