diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-10-22 17:49:15 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-30 08:39:28 -0500 |
commit | 1faac1f7d48d3f7bfa2d168b1ad5680d3288f585 (patch) | |
tree | 0b22b4e1f779608f3917bea94a3a09d5a38096ef /net/tap.c | |
parent | dc69004c7d89afb6ede02ca9379075c062c0c091 (diff) | |
download | qemu-1faac1f7d48d3f7bfa2d168b1ad5680d3288f585.tar.gz qemu-1faac1f7d48d3f7bfa2d168b1ad5680d3288f585.tar.bz2 qemu-1faac1f7d48d3f7bfa2d168b1ad5680d3288f585.zip |
net: move tap_set_offload() code into tap-linux.c
TUNSETOFFLOAD is only available on Linux
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net/tap.c')
-rw-r--r-- | net/tap.c | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -243,27 +243,8 @@ void tap_set_offload(VLANClientState *vc, int csum, int tso4, int tso6, int ecn, int ufo) { TAPState *s = vc->opaque; - unsigned int offload = 0; - - if (csum) { - offload |= TUN_F_CSUM; - if (tso4) - offload |= TUN_F_TSO4; - if (tso6) - offload |= TUN_F_TSO6; - if ((tso4 || tso6) && ecn) - offload |= TUN_F_TSO_ECN; - if (ufo) - offload |= TUN_F_UFO; - } - if (ioctl(s->fd, TUNSETOFFLOAD, offload) != 0) { - offload &= ~TUN_F_UFO; - if (ioctl(s->fd, TUNSETOFFLOAD, offload) != 0) { - fprintf(stderr, "TUNSETOFFLOAD ioctl() failed: %s\n", - strerror(errno)); - } - } + return tap_fd_set_offload(s->fd, csum, tso4, tso6, ecn, ufo); } static void tap_cleanup(VLANClientState *vc) |