aboutsummaryrefslogtreecommitdiff
path: root/net/tap.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tap.c')
-rw-r--r--net/tap.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/net/tap.c b/net/tap.c
index 3f6722ea6c..9b110716e6 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -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)